Clear inspector fragment from teardown(), not close()

close() has a recursion guard and in fact often does recurse,
if the inspector's teardown function causes a selection change.
Unconditionally clearing the fragment in this case will cause
the fragment to be null halfway through the teardown function,
leading to very weird JS errors.

Instead, clear the fragment from the end of teardown(), at which
point the subclass's code has already run its course. ve.ui.Dialog
already does this.

The only reason this doesn't currently break things is because we
have no inspectors that access the fragment after changing the
selection.

Change-Id: Ie97e5b2ef17b56ba4c4a77733e4bd3a5a32f1b71
Merge "Clear inspector fragment from teardown(), not close()"