Use stm-delay to implement timeouts

When a connection is established, we register a new timeout that
indicates that we've not received any network activity. A new thread is
spawned that remains alive until that timeout expires. This thread is
sufficient for closing the entire connection. Whenever a new packet is
received the timeout is reset and extended.