fix TSRMLS compilation error for thread safe environment.