Fix #486, handle connection status properly when recover from sleep

In this change, when beaker get a disconnect change (from cometd), it
will wait for 5 seconds. If within 5 seconds, there is a connect event,
it will try to ditinguish the connect event coming from a valid
reconnect(same session is still availble) from an invalid connect that
can for example come from server crash or user stopping the server
intentionally. If there is no connect event, again within 5 sec of
the disconnect event, and there is a key press event, as well as timeout
after 5 secs, beaker will treat the situation as server is permanently
gone and stop further reconnect attempt and pops up the dialog for
saving the notebook model as a client file (#353)
Do a session backup when a session was created so the server knows about it
For #486, remove keypress event listener with useCapture=true to match how it was added
Reverse the buttons in 'Disconnected' dialog so the behavior of clicking outside maps to 'Not now' instead of 'Save'
Merge pull request #504 from twosigma/alee/fix-486

Fix #486, handle connection status properly when recover from sleep