Psychology says people who remember an embarrassing moment just as they are falling asleep may have a reason