Avoid redundant syscall to make a nonblocking socket nonblocking
Avoid redundant syscall if making a socket cloexec twice

I got the idea from Maxime's last patch.