Improve the db test to check maximum partition number is not exceeded
The next partition to check, as returned by the checked_partition_iter_next() iterator should never return a partition number exceeding the max number of partitions in the config, nor should it addd this in the database.