Ensure the control fd is fd 3

dup the control fd to the "well known" file descriptor 3. This
simplifies checks in the code (reserved fd's are under 4).

Since dup'ing the fd doesn't copy the close on exec flag to the new fd,
perform the fcntl() operation after the fd is dup'ed.