Added a try..finally
Added a try..finally


Former-commit-id: e6103e195209a2e44e4a8fb21dc1888f918d8a9d [formerly 185d3c3c71141b5725bd790ad040cbd57ef285e0]
Former-commit-id: c5ea0a678e2b4facbe4b4842925c245078d6f940
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine