check for load_file before closing, eliminating possible NULL ptr deref

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>