PHP 5.4.29: apply 2 upstream fix