Fix dup3 behavior.