refactor Canvas.timeout_protection in preparation for gemification

closes CNVS-13444

test plan:
- specs should pass
- external services (like turnitin or crocodoc) should still work

Change-Id: I223320f8c6b0dafd79d6e47fbdaedfb6300dc512
Reviewed-on: https://gerrit.instructure.com/35939
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>