Fixed deadlock in zbeacon and zmonitor

- if interrupted, background task did not handle TERMINATE
- general model for background tasks is to ignore zctx_interrupted and
  to work only off API commands.