httplive: use correct segment to calculate duration

Fixes off-by-one segment duration uses, and actually use
new segments length to see how long segments are and when
the playlist should be reloaded.