Fix unpickable DB engine usage in worker threads
Fix unpickable DB engine usage in worker threads

All workers were receiving a "TypeError: cannot pickle '_thread._local' object"
upon startup as of the most recent build of dev. While this was not happening
for everyone, it was happening consistently for me due to what I can only
assume was an unexpected library upgrade. This rogue upgrade cause something
in the multiprocessing library to break(???) that prevented the DB engine
created by the workers at runtime from being pickled and thus being shared by the
data collection thread kicked off when receiving a task.

In order to fix this, I simply moved the initialization logic to
the very beginning of the method run by the child thread. This creates
and disposes of the DB connection at the start and end of the collection process,
thus making the parent thread's data pickable (and thus shareable) by the child
process.

Signed-off-by: Carter Landis <84a516841ba77a5b4648de2cd0dfcb30ea46dbb4@carterlandis.com>

OSSHealth/ghdata,OSSHealth/ghdata,OSSHealth/ghdata