Before this change, upload chunks were being emptied on retry. This change introduces a RepeatableReader to fix the problem.