Fix crash on Mac if Proxy Auto Configuration is enabled and PAC URL contains non-URL legal chars

macQueryInternal() was retrieving the PAC URL string as-entered by
the user in the 'Proxies' tab of the system network settings dialog
and passing it to CFURLCreateWithString().

CFURLCreateWithString() returns null if the input string contains
non-URL legal chars or is empty.

This commit both repairs the URL by adding escapes and also
checks whether CFURLCreateWithString() succeeded.

It does not appear to be possible to enter an empty URL directly in the
PAC configuration dialog but I can't rule out the possibility
that it could find its way into the settings via some other means.

QTBUG-36787
MD-20035