Fix crash when accessing local HTTP server with only /proxy.pac

I was trying to access the local HTTP server with curl:

http://127.0.0.1:51134/proxy.pac

(Assuming 51134 is the port)

But GoAgentX crashed with the following report:

*** Terminating app due to uncaught exception 'NSRangeException',
reason: '*** -[__NSCFString substringFromIndex:]: Range or index out of
bounds'

It because we didn't check if the query exists before trying to call
-substringFromIndex:, the fix will use the current setting from current
service if no query is given.