This is already fixed in CVS, so it should be working in the next release.
What sometimes helps for me is press the autorun key (t for me, but it may be r by default) until the character stops moving, and then do /unstick quickly. If you are stuck too long, it will unstick you back where you are stuck, but if you are fast enough it sometimes works. If not, you can always try to find a GM to slide you a few metres until you are safe.