Swearing 'helps to reduce pain'