Stop main thread when server thread is stopped (#21)