Avoid errors on signals when the engine is run through the server

Quick and dirty fix for https://bugs.launchpad.net/oq-engine/+bug/1310726

I would wait @micheles ok before merging.

Tests running on https://ci.openquake.org/job/zdevel_oq-engine/368