use threading.lock for mkdirs