shm: fix segfault when accessing destroyed pool resource
With wl_shm_buffer_ref_pool(), it's possible for a wl_shm_pool to outlive its wl_resource. We need to be careful not to access wl_shm_pool.resource if it's been destroyed.
Reset resource to NULL in the resource destroy handler, and add NULL checks.
Signed-off-by: Simon Ser contact@emersion.fr