Implement memory hard limit control

Proposal: to avoid loss of control when an OOM occurs on the server we implement an hard memory limit (like we already do with just a warning).

Requires https://github.com/gem/oq-commonlib/pull/60
Move `check_mem_usage` inside the try.. finally, so the `finally` clause should be honored.