Make scripts/powerline use os.environ['PWD'] for .getcwd() if present

Closes #330