SDKeychain memory corruption fixes