memory: double check that mmapfd isn't -1 before closing