Handled EBADF as a result of a close