'Setup.hs sdist': invoke 'tar' with '--format ustar' if possible.

Fixes #1901. Some variants of 'tar' don't support the '--format' option, so we
have to do feature detection.

Note that 'cabal sdist' (as opposed to 'Setup.hs sdist') uses the built-in
tar.gz archiver ('Distribution.Client.Tar') and doesn't invoke 'tar' or 'gzip'.
Merge pull request #1903 from 23Skidoo/issue-1901

'Setup.hs sdist': invoke 'tar' with '--format ustar' if possible.
Append instead of prepending.

"-czf" must go first.
Switch to dropWhileEndLE and takeWhileEndLE

These are faster for sensibly-sized lists/strings than
dropWhileEnd and takeWhileEnd', and equivalent in meaning
to the doubly-reversing implementations. This commit also
replaces (`elem` ['0'..'9']) and similarly strange things
with Char.isDigit and similar.
Merge branch 'master' of https://github.com/haskell/cabal