Return "" for http://:0 URIs since they're technically invalid

Rather than catching all exceptions that might be thrown by parsing
URIs, handle the URI 'http://:0' specially since this has a use case.