Fix a segfault due to freed shandle

- Spin lock should be released before the deallocation of the
corresponding snapshot handle.

Change-Id: I99b1943cb6a3f572b93f57a6f932a54c1593ef3a