Dreaming 'eases painful memories’