jsgui: Undelegate events when closing policy and effector invoke modals

Should prevent > 1 POST to the server.