Fixed a bug with upload with on-the-fly compression
Bug occured when the file size was small enough to be passed through buffer as a single piece, or when the source file size was a multiple of the buffer size.