Fixed segfaults with ZTS on PHP 5.6

Find through Travis, it's already being useful!
Merged pull request #132