Threading scan.py with semaphore