listen thread no longer hangs on exit