Clean up implicit db in worker threads