libusb: Abstract system calls to simplify core code

Before this commit, there were several instances of conditional
compilation in the code code that in large part are directly tied to
which OS backend is being used. This commit removes all conditional
compilation from the core code and pushes this to a single place.

In addition, this change simplifies emulating features on platforms
that don't provide native support.