Fix whitespace hook to work with GNU xargs

GNU xargs behaves differently from BSD xargs in that it always executes the command
at least once, even if there are no arguments on stdin.
As noticed by Martin, this behavior breaks the whitespace hook if the list of files to
be checked is empty. In that case, the hook will now check *all* staged changes, resulting
in false alarms.

So we test which version of xargs we have and use the correct flags in either case. If neither
one works, we bail out and ask the user to file a bug, but this behavior can be overriden with
the environment variable DUNE_WHITESPACE_IGNORE_XARGS.

Fixes FS#1316.
Adjust git rev-parse to modern Git syntax