Fix a regression in DocumentEventQueue.

Due to some inconsistent guards, the event queue could improperly resume
its callbacks when suspended through ActiveDOMObject APIs. Now, an
EventSender callback is only re-added if there are events remaining that
need to be dispatched.
Web Replay: don't show beforeunload dialog when navigating into a recording.

If we are about to unload a frame but the page itself is being captured or replayed,
then we should not delay capturing or replaying with the dialog.
Web Replay: memoize and replay result of beforeunload user dialog.

Closes #394.