Release global lock before calling 'exec'

When using 'opam config exec' the global lock is never released. This
is a tentative fix.