Improve segment appends

These changes cause appends to avoid overlapping and prevent adding segments for a different quality than the most recent init segment appended describes.