Throw an error on upload error returns

If there is an HTTP status returned that is not a success

if (!response.IsSuccessStatusCode)

then the file upload process will throw an exception, terminating the
exception.

As with the previous commit, this is needed since the design of keeping
a single synchronization time for the latest uploaded data requires us
to avoid having gaps in the data.  Just continuing uploading successive
measurements when one fails, will introduce such gaps, and thus we abort
the execution instead.