Refactor: use hasTrailingPathSeparator

hasTrailingPathSeparator is defined as:

hasTrailingPathSeparator "" = False
hasTrailingPathSeparator x = isPathSeparator (last x)
Refactor: introduce function hasLeadingPathSeparator for clarity

Also fix the comment to reflect the code. This fixes #8752.
Bug fix: pathSeparator can be forward slash on Windows

dropTrailingPathSeparator "/" would return "\\" on Windows, since that is the
default:

    pathSeparator = if isWindows then '\\' else '/'

The function `normalise` can be used to normalise pathSeparators in filepaths,
the function `dropTrailingPathSeparator` shouldn't do it for you.

The test now runs for both Posix as Windows.
Refactor: break instead of span and 3x reverse

This works because pathSeparators can only occur at the end of splitPath
elements. h is passed a pathElement without separators.

Add a test to show that superfluous (and a weird combination of)
pathSeparators are still preserved. This function does not normalise
pathSeparators, otherwise it could be simplified further.
Make splitFileName quickcheck test Posix only

See Github #14.