Fix bug and tests on HHVM

Also replace `\Phar::running()` by `0 === stripos(__FILE__, 'phar://')`
because it's not supported in hhvm: http://docs.hhvm.com/manual/en/phar.running.php