Improper location of ghci_history file
## Summary
When XDG directories are used, location of `ghci_history` file is improper.
`getAppDataFile` in `ghc/GHCi/UI.hs` introduced by !7010 and ee5c4f9d05fab41f53364dc18d30932034e6ada6 behaves differently from its comment and the behaviour in its comments is not correct.
## Steps to reproduce
Use `ghci` without an existing `~/.ghc` and do some calculations, and now a `ghci_history` is emplaced in `$XDG_CONFIG_HOME/ghc` or `~/.config/ghc`.
## Expected behavior
| file | XDG location |
| ------ | ------ |
| `ghci_history` | $XDG_DATA_HOME |
| `ghci.conf` | $XDG_CONFIG_HOME |
## Environment
* GHC version used: 9.2.8, 9.4.8, 9.6.3, 9.8.1
* Operating System: Linux
issue