Make connect(2) and mmap(2) generate EBADF instead of crashing.