Use os.path.expanduser() for default credentials

Use os.path.expanduser() rather than relying on $HOME for the
default credentials file.