Fix exception when liverange node is removed from parentNode

Particularly when running tests but also in production code
Deps.flush() will cause a stack trace to be logged to the console
because the _end tag's parent no longer exists.

This patch makes findRange and enclosingRangeSearch check that the
parentNode exists and if not return null.