MFC r260233:

Plug a memory leak in dup2 when both old and new fd have ioctl caps.