Fix a couple of memory leaks in IOHIDCreateDeviceMatchingDictionary caus...

...ed by not releasing keys.

Introduced an RAII-style Core Foundation wrapper class to simplify memory management, and used
it with all CFTypeRef variables.