onion-tunnel: make sure proxy task is done before closing sockets
- We now keep track of sockets' associated proxy tasks in a handle-indexed hashmap, and check the associated proxy task has quit before removing the socket from the socket set.
- This should fix #40 (closed).