Redmine#3731: add promiser_pid and promiser_ppid; Redmine#3819: move get* calls out of tight loop.

Simple match to implement https://cfengine.com/dev/issues/3731

Contains proposed patch for https://cfengine.com/dev/issues/3819 as well.