Add realpath to app_path()

Fix issues when comparing paths for namespace detection on Windows environments.
Merge pull request #6159 from slovenianGooner/master

[5.0] Add "realpath" To app_path()