Refactor: Unindent various code blocks in transport.c.
When we have a condition with a bunch of code under it, these can often
be rewritten to invert the condition and exit which allows all the
previously indented code to be un-indented. This can make the resulting
code easier to follow.