Fix bug 1370151 - PCODE Optimization code was looping forever

Under some circumstances, the PCode optimization logic was calling
memset() with a length argument that was a negative value.

Change-Id: Ie4aa96b6614ccfe9ffe6fb5d88cca41a046c7de7
Merge "Fix bug 1370151 - PCODE Optimization code was looping forever"