cvar: fix many bugs in gamedir, loadconfig, unset, cvar_resettodefaults* commands
Fixes a segfault when Cvar_RestoreInitState() deleted cvars (null ptr deref).
Fixes an infinite loop in Host_LoadConfig_f() due to calling Cbuf_Execute()
from inside Cbuf_Execute() via Host_AddConfigText().
Fixes `unset` being able to delete autocvars while they're in use by QC.
Fixes Cvar_RestoreInitState() not updating autocvars when necessary.
Fixes Cvar_RestoreInitState() not calling cvar callbacks.
Fixes Cvar_RestoreInitState() sometimes restoring such that .string
doesn't match .value, or such that .defstring is wrong. This was caused
by Cvar_SaveInitState() saving only string pointers and not strings.
Fixes CF_READONLY cvars like gl_info_* getting restored/reset. It
doesn't make sense for any of these to be changed by code outside their
own subsystems.
Fixes Xonotic menu QC errors caused by Host_LoadConfig_f deleting cvars
before calling QC's m_shutdown().
Deduplicates and simplifies cvar deletion code, see also
05a5ed884366d3a1c8e211168efc19b61867cfca
Saves a little memory by storing only minimal init state data for
Cvar_RestoreInitState(), and by relaxing alignment requirements in
_Mem_strdup().
Improves some warns and docs and tidies up a little.
Removes `vid_restart` from `gamedir`, it usually isn't needed because
current DP applies many vid_ cvar changes without it, and because of
the ubiquity of flat panel displays.
Fixes https://gitlab.com/xonotic/darkplaces/-/issues/354
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>