Fix a couple of memory leaks in IOHIDCreateDeviceMatchingDictionary caused by not releasing keys.

Introduced an RAII-style Core Foundation wrapper class to simplify memory management, and used
it with all CFTypeRef variables.
Merge branch 'trojanfoe' of https://github.com/trojanfoe/GamePlay into trojanfoe