Catch issue in config set with no config file

This prevents a segfault when setting a value in the config of a repository that doesn't have a config file. Fixes #1517