Fixes #2724, leak with non-specific calls to stopListening.