Improve keyring debugging
Improve keyring error messages
Improve more keyring error messages
Some keyring refactoring and improvements
Improve keyring test case
Remove unwanted DEBUG statement
Fix keyring SEGV bug

Sometimes, when adding a PIN to a keyring (eg, when opening a keyring
file), a SEGV would be caused while trying to validate the MAC for an
entry which apparently had zero keypair entries.

Changed some keyring struct 'int' fields to 'unsigned int', to ensure
that comparison logic behaves as expected.

Refactored some keyring code for more clarity and code maintenance
safety.

Added TODO comment about keyring file format non-back-compatibility.
Fix Solaris SIGBUS bug in MDP ping

Also fixed non-portable (endian dependent) code