Fix seeking issue
Created by: bbert
In BufferController, when seeking, a segment may being appended into the buffer. Therefore if we do prune the buffer before the current segment appending process is completed, then the range to be removed is erroneous (does not take into account current segment being appended). This can have side effects and leads to playback freeze. On some devices, appending process can take a relatively long time and can more easily highlight this issue.
This PR attempts to fix this issue by waiting for segment appending process to be completed before pruning the buffer at seeking.