build the files db in a worker thread

Had a negligible performance impact on decent repos while improving
performance on large ones.