Re-work read_file a bit.
Re-work read_file a bit.

The previous version didn't check for allocation failure
on data, and also had duplicated code for close.  Clean
it up to be a bit more robust.

Signed-off-by: Chris Lalancette <60b62644009db6b194cc0445b64e9b27bb26433a@redhat.com>

clalancette/condor-dcloud,clalancette/condor-dcloud,clalancette/condor-dcloud,clalancette/condor-dcloud,clalancette/condor-dcloud,clalancette/condor-dcloud,clalancette/condor-dcloud