HIDDevice: WriteDeviceNameToFile: check lengths, close return value
HIDDevice: WriteDeviceNameToFile: check lengths, close return value

Addresses security concern:

WriteDeviceNameToFile does not check buffer lengths, and uses a fixed
size of 19, though this is likely safe due to how the kernel builds the
/sys tree entries. Also fails to check return code of "close".

adlr/rmi4utils,adlr/rmi4utils