Python build scripts must avoid use of os.chdir() if they want to work with j2 and higher

Change-Id: I8de1c700003200bc3c547761701a97b12e0f60a4