Ensure file handle cleanup during image creation

* When uploading an image to glance from a file,
  perform the close operation from finally block
  to avoid waiting for handle to be closed when
  reference count goes to 0

Change-Id: I5c3ee35b87fa55097c2e847836d5ad1764ae0574