core: Fix bug for duplicate notifications.

Once a client is terminated, we need to clear out the notfications hashmap.
test: Cover case of terminate client removing notifications