hid-recorder: fix missing frees

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
hid-recorder: break out fetching information and retrieving events

Enhance a little the readability, and will allow further changes in
retrieving the events through hid debugfs.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
hid-recorder: use HID debugfs when available

Using hidraw for retrieving the events is problematic when the kernel
driver consumes the events in .raw_events().
hid-logitech-dj and hid-magicmouse are such drivers.

For those drivers, the hidraw node does not deliver any events, whereas
the HID debugfs does.
To use the HID debugfs, we need to find out which event node is the right
one, by comparing the name in /sys/kernel/debug/hid and then the actual
report descriptor in the rdesc node.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Switch the license from GPL v3+ to GPL v2+

GPL v3 might trouble some companies, so use a GPL v2+.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>