CAS-1397: Add null checks for get and put operations

Original pull request: https://github.com/Jasig/cas/pull/371
JIRA: https://issues.jasig.org/browse/CAS-1397