libvirt: Close opened file explicitly

Every opened file should be closed properly.

Change-Id: I5405638ba033f75957461c0ad33be9f0c6a17e3b
Merge "libvirt: Close opened file explicitly"