fix file handling when download is interrupted
since the download is started with multiple threads writing to the download file on different offsets, those offsets will not reach the end of their quantum when the download is interrupted and the file is still saved with full size or near full, which messes the logic of starting or playing an existing file, the solution is to remove any unused spaces in the file allocated when starting the download so when it is interrupted and restarted again, the actual downloaded size can be calculated and resumed