Fix address collision in PTHREADS_ZG(resources)

Each time a resource created in another thread context is used, its address is added to `PTHREADS_ZG(resources)`. Until then it was never removed and since `PTHREADS_ZG(resources)` is tested on every resource destruction attempt, collisions would occur after some time (when `PTHREADS_ZG(resources)` contains a few hundred addresses) preventing unrelated resources from being destroyed and causing memory access violations.

Here is what was observed with Valgrind:
```
Thread 12:
==00:00:35:12.339 23371== Invalid read of size 8
==00:00:35:12.339 23371==    at 0x896C451: pthreads_resources_kept (resources.c:51)
==00:00:35:12.339 23371==    by 0x896809A: pthreads_prepared_resource_dtor (prepare.c:780)
==00:00:35:12.339 23371==    by 0x98AAF2: i_zend_hash_bucket_delete (zend_hash.c:182)
==00:00:35:12.339 23371==    by 0x98C3CB: zend_hash_del_key_or_index (zend_hash.c:526)
==00:00:35:12.339 23371==    by 0x98F0E2: _zend_list_delete (zend_list.c:57)
==00:00:35:12.339 23371==    by 0x8D9C12: _php_stream_free (streams.c:470)
==00:00:35:12.339 23371==    by 0x803445: zif_fclose (file.c:914)
==00:00:35:12.339 23371==    by 0x9C526F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==00:00:35:12.339 23371==    by 0x9CBD4B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==00:00:35:12.339 23371==    by 0x9C44C6: execute_ex (zend_vm_execute.h:363)
==00:00:35:12.339 23371==    by 0x9C45AB: zend_execute (zend_vm_execute.h:388)
==00:00:35:12.339 23371==    by 0x8970EE2: pthreads_routine (object.c:967)
==00:00:35:12.339 23371==    by 0x6B6DB4F: start_thread (pthread_create.c:304)
==00:00:35:12.339 23371==  Address 0x162f9378 is not stack'd, malloc'd or (recently) free'd
```

Further debugging with gdb querying PHP's internal structures proved that the zif_fclose (fclose()) call triggering this overflow was closing an unrelated local resource that could not have been added to `PTHREADS_ZG(resources)`

This fix resets `PTHREADS_ZG(resources)` to what it was after the initial `worker::run()` before executing any new tasks.

While working on this fix I uncovered another bug: `php_request_shutdown()` destroys `PTHREADS_ZG(resources)` before destroying `EG(symbol_table)` which prevent resources to be kept in `::run()`'s 'local' variables when a worker is terminated.
I couldn't imagine a simple fix for that one except using a persistent global variable for `PTHREADS_ZG(resources)`...