analytics: populate next_end_date correctly

Use the time between two transitions, not the phase length (except for the
last one).

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>