Improve InstanceIdentifier.keyOf()

Rather than throwing a ClassCastException, this documents that the
keyOf() method can throw an IllegalArgumentException.

Change-Id: I5d5b9e10c7329c6bc909b28b07c7bc6500cfcd5a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Merge "Improve InstanceIdentifier.keyOf()"