Make sure exec_sync_loop is stopped properly when a mail client drops it's connection by catching exception thrown by close in this case. This was causing connection count to be wrong on linux mail server and an outright crash on windows mail server.