Fixes infinite loop issue on Windows

On Windows, `read_config` will never return because going up the directory tree will never result in '/'. This fix adds this logic.