bugfix: properly expand env vars

If no sqlite path was specified, a new dir called $XDG_DATA_HOME was created
in the current dir. Also consistently use XDG_DATA_HOME.