Handle a missing keychain item

Also, I just couldn't resist "fixing" your perl code. ;)