Add realpath for Windows

Fixes #4446