add OLDPWD preservation logic

needed in riaknostic and possibly other things.
stores the original PWD and preserves it through 
sudo, if necessary. it's unset by silly shell behavior
on at least OSX.