Make StatefulTransport a contextmanager and use it to handle setting transports idle after use