Update code logic, remove ASSERT and use error handling. 

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: svn://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg@15403 6f19259b-4bc3-4df7-8a09-765794883524
Calculate enough space for 2 variables (public key and variable data) instead of directly setting them 1 by 1.
Fixed a bug in public key reclaim().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Zeng, Star <star.zeng@intel.com>

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