Destroying the default context twice, even if it is refcounted, results in a segfault.
Fix submitted to libusbx as pull request #116.
Also fix this inside the Java wrapper, by adding our own refcount (similar to what was in original usb4java,
but allowing multiple calls with the default context), and making the access to said variable thread-safe.
Once libusbx fixes this, the above code can be removed.
Issue expected exception when default context refcount is zero or smaller.
Make sure that returning a new reference always leads to a new Java object being created, else
freeing/unref'ing that one would lead to the reset of the original object too.
Furthermore, ensure that getDevice also increments the reference count, since if you then free it,
which is usual and not forbidden (libusbx docs just tell you are not obligated to unref it), the
reference count would be wrong and lead to a segfault. This way it would lead at most to keeping a
device around, instead of segfaulting. Still, always free your references!!!
Fix descriptor dumps. Forgot to shift the masked values, other minor changes.
Fix tests: use direct int buffers where needed, it's Implicit and not Explicit, the class 5 is known.
Setting devHandle or buffer to NULL in Transfer is not supported (doesn't make sense at all...).