lib/srdb1: helper function to reallocate the index for result rows

- useful for db connectors that don't know in advance the number of rows in result
db_mongodb: proper result conversion to DB APIv1