The controllistener could be freed before the event posted by isc_nm_stoplistening() has been processed. This commit adds a reference counter to the controllistener to determine when to free the listener.
named -V