Fix for Memory leaks in Keychain

Fixes for memory leaks in Keychain access