Fix bug #20284:  RunTest does not reset the interpreter before running the
--CLEAN-- section after running a test that needs the php-cgi binary.

Without this patch the cgi binary will output its headers, making RunTest
barf on the output in the --CLEAN-- section.

The commit also moves the save / restore feature of which binary to
use to two dedicated functions, to allow for improved reuse.
Fix bug #20286: Support access of static variables on objects in validator

Original fix in https://github.com/pear/pear-core/pull/22/files