Redmine #4716: Lots of fixes to dirname(), esp. on Windows.

These problems were fixed:
* AddSlash() always adds Unix slash when argument is empty.
* DeleteSlash() removes root slash.
* FirstFileSeparator() returns NULL on all relative Unix paths, even
  if it has a file separator.
* ChopLastNode() gives empty string when removing last directory
  component of a relative path. It should give '.'.
* ChopLastNode() does not handle Windows drive letters.
* IsAbsoluteFileName() does not handle absolute paths on Windows that
  don't start with a drive letter. Both types are considered absolute
  paths.

This also fixes a Windows issue where creating a directory in policy
would lead to an error message about not being able to chdir into a
directory with the name ''. This was due to the final root slash not
being preserved.
Begging to be re-structured:
```
const char *in[] = { "/tmp/myfile", "tmp/myfile", "c:\\tmp\\myfile", "\\\\my\\ms-win\\share" };
const int off[] = { 0, 3, 2, 1 };
size_t i = sizeof(off) / sizeof(off[0]);
assert(i == sizeof(in) / sizeof(in[0]));
while (i > 0)
{
    i--;
    assert_true(FirstFileSeparator(in[i]) == in[i] + off[i]);
}
```

DRY.