Fixed PHP-1278: runcommand memory leak
Merged pull request #770