Research finds that dreams may help consolidate and soothe troubled memories and experiences. Christie Nicholson reports