fix issue with infinite loop existing a partially completed quiz

fixes CNVS-11763

test plan:
  - login as a user
  - take a quiz in Chrome
  - while taking the quiz in, press 'backspace' or 'delete' twice quickly
  - prompt 'are you sure you want to leave this page?' appears
  - you should be able to dismiss the prompt and remain on the page

  - other things to check
  - trying to leave multiple times will continue to show the prompt every time
  - you should be able to successfully leave the page from the prompt

Change-Id: I1e9454ae902e6686f48c48f1c05cf1e28f2d0c39
Reviewed-on: https://gerrit.instructure.com/41457
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>