(#18092) Use CGI.parse on network URI query

The current implementation of the network device enable password parsing
is unable to handle characters like sharps and spaces in the password,
which are valid passwords. This commit adds CGI parsing of the query
string to only extract and unescape the enable query parameter.

This supercedes GH-1327 and GH-1491.