Don't use magic constants when determining the server root

Moving request.php from lib/ to lib/private/ broke
overwritehost/overwritewebroot support.
Use realpath() to determine the server root directory instead of using
magic contants.

Fixes: #5849