Clean up notification handles returned from Observable queries. Added condition to test case. Fixes #17394.