Respect the $YACC environment variable.

This changes is effectively in master already, but should be backported to 5.4 and 5.5 to make compilation easier on OS X (which ships with a now-unsupported version of bison). This merges up to PHP-5.5 cleanly, and can be merged into master with an easily resolved conflict.