hls: Improve handling of missing segments

Fixes #2385