use with statement to take care of unclosed files

Change-Id: I0c33b22aa9828245c4598622ae6870f13b797036
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1128715
Signed-off-by: Yeela Kaplan <ykaplan@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/31717
Reviewed-by: Dan Kenigsberg <danken@redhat.com>