diff --git a/gdata/gdata-upload-stream.c b/gdata/gdata-upload-stream.c
index c0eef5a..664ed0a 100644
--- a/gdata/gdata-upload-stream.c
+++ b/gdata/gdata-upload-stream.c
@@ -472,10 +472,10 @@ close_cancelled_cb (GCancellable *cancellable, GDataUploadStream *self)
 	GDataUploadStreamPrivate *priv = self->priv;
 
 	/* Set the error and signal that the close operation has finished */
-	g_static_mutex_lock (&(priv->response_mutex));
+	//g_static_mutex_lock (&(priv->response_mutex));
 	g_cancellable_set_error_if_cancelled (cancellable, &(priv->response_error));
 	g_cond_signal (priv->finished_cond);
-	g_static_mutex_unlock (&(priv->response_mutex));
+	//g_static_mutex_unlock (&(priv->response_mutex));
 }
 
 /* It's guaranteed that we set the response_status and are done with *all* network activity before this returns.
@@ -550,6 +550,9 @@ wrote_chunk_cb (SoupMessage *message, GDataUploadStream *self)
 	length = gdata_buffer_pop_data_limited (priv->buffer, buffer, CHUNK_SIZE, &reached_eof);
 	if (reached_eof == TRUE) {
 		/* We've reached the end of the stream, so append the footer (if appropriate) and stop */
+		g_static_mutex_lock (&(priv->response_mutex));
+		g_return_if_fail(priv->response_error == NULL);
+		g_static_mutex_unlock (&(priv->response_mutex));
 		if (priv->entry != NULL) {
 			const gchar *footer = "\n--" BOUNDARY_STRING "--";
 			soup_message_body_append (priv->message->request_body, SOUP_MEMORY_STATIC, footer, strlen (footer));
