Find another workaround for the PHP bug #65136.

The previous fix did not work in rare cases. This fix seems to work
well. It avoids a seg fault and a bus error (when compiled with
--enable-dtrace).