changed applyToDatabaseNames to use batching #1059

Inlining the work in the callback leads to a deadlock with checkpoint if a
checkpoint begins before we call back into the ydb while processing _f.
Merge pull request #1060 from Tokutek/bugs/1059

changed applyToDatabaseNames to use batching

fixes #1059