UP-4192 CVE-2014-5059 guarantee CAS security context successfully sets principal ID.

Detects and throws in case where principal UID setting is blocked.