Fixing segfault when trying to free memory frames after a fatal php error