Update pfm.cc

Return error if attempting to close a file that has already been closed.