Make sure we *always* release the resource when leaving an action

Including in case of exceptions ;-)
Implemented a mechanism to signal cancellation/pause to actions

This is based on triggering custom exceptions (ActionCancelled/ActionPaused) within the
action thread by abusing sys.settrace.