Dev: apache: refactor pid use

ApachePID was a global variable set in a function as a
side-effect. This patch makes the pid processing more obvious.
Merge pull request #293 from dmuhamedagic/apache-pid

Dev: apache: refactor pid use