It's simpler to just use _currentOutputDir
Set _currentOutputDir correctly, handle trailing slash

Note that _currentOutputDir didn't get set since visitDir is not
invoked for the parent directory. So now we always set it. Another
problem is that converting to a canonical representation of the
path strips the trailing slash. So we check the trailing slash on
the original string received from argv.