fix memory leak in ioctl_capabilities()
improve capability formatting in evtest
fix memory leak in device_read_many() and device_read()
silence 'cast to pointer from integer of different size' warning