Correct the RemainingPages calculation in PEI AllocatePages service.

Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: svn://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg@15035 6f19259b-4bc3-4df7-8a09-765794883524
Update the heap migration logic to avoid memory overflow. 

Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: svn://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg@15036 6f19259b-4bc3-4df7-8a09-765794883524