Fix issue #43

I've lost the test environment where I fixed this originally but I believe this was the only modification when I fixed this issue for myself.

Do note that this may be a Passenger-specific fix (Passenger v4 wraps requests in bash -li thus affecting the environment provided to scripts); please ensure that it's tested on another app server before accepting.