Clean up the listen thread when it's finished.