Fix pig install script

* use a working shebang line
* fix a few cwd issues
* fix the export of $PIG* env vars