Critical slowing down as early warning for the onset and termination of depression