Backported changes made from SVN 5550

Backported the changes made by the iRODS team in commit r5550. These
changes making the ticket authentication code more robust.