Fixed a race condition where notifications could get lost if their write succeeded after the connection had handled a rejection, but before the connection had closed.
Clear the sent notification buffer after sending unprocessed notifications back to the listener.