ota: fix incorrect error handling in config loading loop
The first patch fixes a real issue. The remaining two make the resource usage constant regardless of the number of given files and make the code easier to follow, respectively.
Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@huawei.com