TS-1475: Fix resource leak on failure case in Store::read_config