Added sandboxing to action_hooks

This change adds sandboxing to the various action hooks (which allow users to
insert buttons or menu items into various pieces of the UI), so that broken
extensions won't break everything.

Testing Done:
Unit testing done - tested all 5 different action hooks (DiffViewerActionHook,
HeaderActionHook, HeaderDropdownActionHook, ReivewRequestActionHook,
ReviewRequestDropdownActionHook) with and without the sandboxing. Ran on all
tests in extensions/tests.py

Reviewed at https://reviews.reviewboard.org/r/5710/