[stable5] Adding detection of aborted uploads for chunked uploads

Backport of #4867 to stable5 - Fixes #4546 

@ogoffart @karlitschek @bantu THX