MDL-38538 quiz autosave: improve the JS

1. Admin setting to control the delay, or even turn it off.
2. Detect changes in TinyMCE editors.
3. Detect changes in hidden fields, such as those used by drag-drop
questions.
4. More care about not triggering one save until the previous one was
finished, but do save again if changes are made during the previous
save.
5. Do not trigger a save if there is only a short amount of time left in
the quiz.