[Backport to v9.18] Synchronise stop listening operation for multi-layer transports
This commit introduces a primitive isc__nmsocket_stop() which performs shutting down on a multilayered socket ensuring the proper order of the operations.
The shared data within the socket object can be destroyed after the call completed, as it is guaranteed to not be used from within the context of other worker threads.
(Backport of !6917 (merged))
Edited by Artem Boldariev