Merge Tim's error handling changes to sync with the testbed/xmlrpc copy, add support for the Win32 platform.