projects: purge perl's perfidious file handle trickery
When spawning a git or shell command, we are not interested in what
the perl filehandles are set to; they may be tied objects or have
unanticipated file descriptor numbers.
We do, however, care greatly about where the underlying file
descriptors 0, 1 and 2 point to as those will become the spanwed
process's STDIN, STDOUT and STDERR respectively.
Therefore make use of the various POSIX APIs to manipulate the file
descriptors directly to make sure they end up pointing to the
intended target before spawning a sub process.
Also take this opportunity to replace the few remaining bare
'/dev/null' strings with the more portable File::Spec->devnull
result.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>