Get the fd from mem.
mem
Call is_fd_memory to check if mem has an fd.
Memory
the fd of mem or -1 when there is no fd on mem