Add some CPPFLAGS to cppcheck arguments
Protect session cache calls from sess == NULL
Fix X509_NAME_get_text_by_NID() error handling