rpc: pass errors from async_accept and avoid leaks

Some commits to (hopefully) improve RPC behaviour:

- Pass errors from async_accept
- Make sure connection object is always cleaned up
See individual commit messages for details.
- Make sure that acceptors and timers are cancelled before exiting the event loops.