misc: Use with statement instead of try finally

Using with make the code much more readable and ensure that you cannot
forget to release a lock, or place the try finally incorrectly.

We probably can fix this in other places, but since this is very
delicate code, it is best to do this is tiny steps.

Change-Id: I8fb6485850381dfbba56c5f08feaa826045e28a6
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/28611
Reviewed-by: Yaniv Bronhaim <ybronhei@redhat.com>
Reviewed-by: Federico Simoncelli <fsimonce@redhat.com>