Fix #CR-1863

Check return value on emsabp_set_PermanentEntryID while building up
PR_ENTRYID and prevent from trying to build value on corrupted data.