inc/functions.inc.php: rm trailing slash in base and resolve symlink

When there was a symlink in the path of $base, strpos($realpath, $base)
would have always return false.

Closes: https://github.com/pommi/CGP/pull/49