Live Preview - Fix currentDocumentChange handling

Check if the server can display the new document before starting a new live dev session. Cleanup disconnect handling.

Fixes #4966