Allow $HOME and ~ usage in all *-dir config values, fixes #3060