Fix a unit test which fails when run with Xcode6 / iOS8

Fix a unit test which fails when run with Xcode6 (at least on an iOS8 simulator).  It looks like the internal HTTP NSURLProtocol returns NO from canInitWithRequest: if the URL has invalid characters like this, meaning no NSURLProtocols match it, and we get an NSURLErrorUnsupportedURL instead of NSURLErrorBadURL.  So, accept either error code.   Also changed some local variable types to avoid compiler warning.