DevTools: handle beforeunload event on DevTools frontend

This patch handles beforeunload event on DevTools frontend to show
modal dialog in case of unsaved files in workspace.

BUG=289552

Review URL: https://codereview.chromium.org/76603003

git-svn-id: svn://svn.chromium.org/blink/trunk@163354 bbb929c8-8fbe-4397-9dbb-9b2b20218538