PHAR: Fix accepting ill-formed UTF-8 characters

This fixes UTF-8 checking bug introduced in PR #588