Fix a stack smash when SHA2 certificates are used
From https://jira.opensciencegrid.org/browse/SOFTWARE-1333
Fix compilation problems when strndup is already defined