Fixes to quit steps and fix for error message on join

network.py Catch the 115 error, which indicates that the socket is in
the process of async connecting to the server, select will handle making
sure it's writeable later

commandbot.py - Make sure we only close the db connection after all
events have been processed