Fix the runner to test on directories in Windows

The runner previously tested if a file could be executed as a test before
checking if it was a directory. Windows reports file mode differently
than *nix. To fix the problem I've moved the directory checking before
the file checking.