fdmemory: add flag to avoid close of the fd