Make application PID file location configurable from Environment property

The pid file location can now be set from a system property or from an environment property. If none of them is found, the defaults are applied.

Fixes gh-1579