Improve option parsing

The existing code did not provide for escaping characters, which made
certain option values impossible to represent, for example:

 password='spaces and ' a quote'

In addition, ParseUrl would not allow even a single space in any value.

Add standard backslash escaping, matching libpq's own conninfo_parse.

Apply this escaping to special characters in ParseURL.