Revert "Remove XEmacs compat code from savehist.el"

This reverts commit a97ba6eb.

According to bug#36324, this broke savehist.el
1 job for master in 51 minutes and 56 seconds (queued for 3 seconds)
Status Job ID Name Coverage
failed #2316


Name Stage Failure
test-all Test
make[2]: *** [check-doit] Error 1
Makefile:318: recipe for target 'check-doit' failed
make[2]: Leaving directory '/builds/emacs/emacs/test'
Makefile:293: recipe for target 'check-expensive' failed
make[1]: Leaving directory '/builds/emacs/emacs/test'
make[1]: *** [check-expensive] Error 2
Makefile:959: recipe for target 'check-expensive' failed
make: *** [check-expensive] Error 2
ERROR: Job failed: exit code 1