If htmladmin fails to connect to the server, the cgi could crash.
(cherry picked from commit 2076085457e0487f115fdbc2a2c7f100b5bab1af)
(cherry picked from commit 5d453d2dae36c2929be0d94c6d72e8ec1f0598aa)
(cherry picked from commit fcc6e05c619861e7db83f919a329adf344379f91)