Improved error logging
Handle redirects correctly

A regular HTTP redirect will turn a POST request into a GET one, and
xmlrpc.php will return "XML-RPC server accepts POST requests only.".

When we detect a redirect, make sure we send the same request to the new
URL, and that's the URL we return as valid.

Also added better logging of redirects.