commands.c: Fix URI reformatting if the host is an IPv6 address