Patients with depression find it easier to abandon unattainable goals, a psychological study has concluded.