posix_spawn(): dup2() returns a fd on success, -1 on error. * duplicate the just opened file descriptor, instead of the target file descriptor. * fixes #14308.