Port apcu fixes from 2.x to here.
Port apcu fixes from 2.x to here.

These fixes helped fix apcu installation issues in 2.x. Hopefully they
do the same here.

dakota/cakephp,mvdriel/cakephp,ADmad/cakephp,tenkoma/cakephp,ndm2/cakephp,davidyell/cakephp,mvdriel/cakephp,garethellis36/cakephp,ADmad/cakephp,dakota/cakephp,CakeDC/cakephp,petteyg/cakephp,ndm2/cakephp,tenkoma/cakephp,garethellis36/cakephp,cakephp/cakephp,cakephp/cakephp,ADmad/cakephp,dakota/cakephp,mvdriel/cakephp,ndm2/cakephp,ADmad/cakephp,davidyell/cakephp,CakeDC/cakephp,CakeDC/cakephp,CakeDC/cakephp,petteyg/cakephp,tenkoma/cakephp,cakephp/cakephp,dakota/cakephp,mvdriel/cakephp,ndm2/cakephp,garethellis36/cakephp,petteyg/cakephp,tenkoma/cakephp,garethellis36/cakephp,davidyell/cakephp,cakephp/cakephp,petteyg/cakephp