close socket in a separate thread and only await stopLatch for 2 seconds - as it close could be called by InactivityMonitor