Clear notifications where necessary, and not during clear_cache

Fixes frappe/erpnext#1871