libthr: add pshared_destroy() helper
(cherry picked from commit 3cf37d1251bf71b2171e67af8f2ca43cbe3d874d)