Acquire lock on file before opening code
Acquire lock on file before opening code

This actually makes a lot more sense than acquiring just before running

This prevents TOCTTOU problems when reading in code

In addition, adding "del localvar["_Launcher__process_alive"]" caused a
race condition in an unrelated test before this change

rlee287/pyautoupdate,rlee287/pyautoupdate