Backport to 2.4.x of GEOS-6711: improvements to authkey security module