People who swear more often are more honest than those who don't, a study found.