PHP native extension that generates segmentation faults