Reorganize code in preload library

Move the file access wrappers to the bottom, as they need to access the more
specific wrappers such as sockets and ioctls.
Consistently name ioctl recording
Emulate simple USBDEVFS_* management ioctls

This covers CLAIMINTERFACE, RELEASEINTERFACE, CLEAR_HALT, RESET,
RESETEP, GETDRIVER, and IOCTL. These have fixed responses which do not depend
on a particular device or operation.