Use ~/.config/grafx2 when the XDG_CONFIG_HOME is not set
Follow the freedesktop spec.
Thanks to skrzyp for noting this important detail.