hls: Better handling of missing segments (avoid crashing)

Fixes #2402