If we have the partition table without any ota_apps but in ota_data have valide entry, in this case we get an error(hang). This commit fix this case. If bs->app_count is zero when selecting the factory app. Closes https://github.com/espressif/esp-idf/issues/2218