Add overwritehost config on setup and upgrade

overwritehost should always be configured to prevent Host Header Poisoning, this commit adds the config option on upgrade and on new installations automatically.

Backport to stable5 and stable6 requested. But I assume the code base is too different for a simple cherry pick.

\cc @karlitschek