Fix TSRM issues and add option not to track internal functions

(trace) missing for versions before PHP 5.4

While trying to build PHP5.3.28 had failures because I was using -DZTS and there were a couple of calls missing the usual TSRMLS_CC.

I also needed to ignore internal function calls and just check scripted functions so I added an option to ignore them (default is current behaviour).