__main__: Remove unused imports
__main__: Turn start_worker_in_background into a method
__main__: Rename lost_lock_callback method