Better support for phar file paths.

Notably, realpath now checks if the file exists in a phar and returns false if it doesn't. This fixes bug #20231.