Converted Transport to context managers.

Transports should be used as context managers. This allows for thread safe read and writes.