jsgui: Undelegate events when closing policy and effector invoke modals

Should prevent > 1 execution.
Merge pull request #1355 from sjcorbett/jsgui-effector-invoke

jsgui: Undelegate events when closing policy and effector invoke modals