Merge memory limit fix in PHP 5.2, 5.3 and 5.4 patches. Merge post handler fix in PHP 5.3 and PHP 5.4 patches. Both from upstream.