Convert Transport to context manager