mingw: Add implementation of realpath()

The mingw port used _fullpath() until now, but the behaviour is not exactly
the same as realpath()'s on unix; major difference being that it doesn't
return an error for non-existing files, which would bypass main's error
checking and bail out without any error message when the input file does not exist.
Also realpath() will return forward slashes only since main() relies on that.