Change g_log_set_handler to g_log_set_default_handler so we could set handler for debug log level in tests/common.c.
Added functions gdata_test_debug_output, gdata_test_debug_handler and GSList message_list for collecting debug messages in memory and printing out only when needed (including pretty printing XML). Closes https://bugzilla.gnome.org/show_bug.cgi?id=627895
Replacing g_log_set_default_handler with g_log_set_handler

Replacing g_log_set_default_handler with g_log_set_handler for all message types except G_LOG_LEVEL_DEBUG, as setting default handler means it catches messages from all other domains, t.i. from other libraries and applications.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=703192
core: Fix idle callback priority for batch operation callbacks

Occasionally, the callback for an async batch operation as a whole was being
called before the callbacks for the individual operations in the batch. This
was causing the YouTube tests to spuriously fail every so often.

Fix this by setting the callback priority for operation callbacks to be the
same as that of the entire batch.
core: Fix error notification of cancelled messages

If a message is cancelled during (e.g.) DNS resolution or SSL handshaking,
libsoup will return SOUP_STATUS_SSL_FAILED (and friends) rather than
SOUP_STATUS_CANCELLED, which was causing occasional spurious failures in
the test suite (due to the wrong error messages being set). Fix this by
explicitly converting SOUP_STATUS_SSL_FAILED (etc.) to
SOUP_STATUS_CANCELLED if the cancellable is cancelled.
tests: Move stream creation out of setup and into test functions

Resetting the stream (seeking back to the beginning and clearing pending
operations) was too fragile, and resulted in spurious test failures.
tests: Fix a YouTube test name
core: Write upload chunks in an idle handler to avoid stack overflow

Otherwise the used stack size would be proportional to the number of
chunks uploaded by GDataUploadStream, and hence stack overflow could
potentially occur.
tests: Update test account password