configure.ac: Use LIBS instead of PC_LIBS_PRIVATE
configure.ac: Move THREAD_CFLAGS into AM_CFLAGS
configure.ac: Move VISIBILITY_CFLAGS into AM_CFLAGS
configure.ac: AC_SEARCH_LIBS(clock_gettime) to be able to add -pthread
darwin: reduce number of times libusb attempts to retrieve a device
descriptor during enumeration

On failure it doesn't make sense to keep on trying to enumerate a
device more than a couple times. Reduce the number of tries from
10 down to 3.

Fixes #151
darwin: don't bother retrying or unsuspending Apple devices during
enumeration

Some devices appear to cause the keyboard and mouse to lock up
after repeated enumeration. Try to avoid the issue by not attempting
to unsuspend Apple devices.

Fixes #150
darwin: use Release instead of IODestroyPlugInInterface to avoid stopping
IOServices associated with a device

Some IOService subclasses with actually stop if IODestroyPlugInInterface is
used to release the plugin interface. This is likely what causes the
keyboard and mouse to lock up. Using Release should prevent this from
happening.

Fixes #139
Fixes #150
Fixes #153
clean up tabs
darwin: add support for detecting superspeed devices (IOUSBFamily 5.0.0 or newer)
core: Keep a list of contexts (active_contexts_list) created by libusb_init. The list can be used by backends to determine which contexts need notification of device removal (and in the future device arrival). The active_contexts_list is protected from multiple access by the active_contexts_lock.
core: cache device descriptors in the core

Discussion: It is necessary to cache the device descriptor in the core to
support reading the descriptors after a device is disconnected. We could
either 1) allow each backend to handle this caching (which would most
certainly duplicate code), or 2) cache the descritors when a device
is added. This patch does the later.

Further discussion: It might be beneficial to cache more than just the
device descriptors in the core. It might also be worthwhile caching the
configuration and BOS descriptors as well.
Add hotplug support. Bump the version to 1.0.15 and change the so version to
reflect external API changes.

The internal API is changing as follows:
 - Adding two new functions. usbi_connect_device, and usbi_disconnect_device.
   Backends must call these functions to add them to the context's device list
   at one of two places: initial enumeration (done at init), and on device
   attach and removal. These functions need to be called once per context.
 - Backends that support hotplug should not provide a get_device_list funtion.
   This function is now deprecated and will likely be removed once all backends
   support hotplug.

The external API is changing as follows:
 - Two new functions have been added to register and deregister callbacks for
   hotplug notification: libusb_hotplug_register_callback(),
   libusb_hotplug_deregister_callback(). Hotplug callbacks are called by
   libusb_handle_events(). Details of the new API can be found in libusb.h.
 - A new capability check has been added to check for hotplug support. See
   LIBUSB_CAP_HAS_HOTPLUG.

Aa suggested by Xiaofan add new example has been added to show how to use
the new external hotplug API. See examples/hotplugtest.c.

References #17
Add hotplug support to the Darwin backend.

Hotplug events are handled by the async event thread. This thread listens for
two events: kIOTerminatedNotification, and kIOFirstMatchNotification. If
either of these events fires the thread will iterate through the appropriate
iterator and will either enumerate or call usbi_disconnect_device depending
on the event.

While adding hotplug support it was discovered that when reading from the IO
registry we need to use kCFNumberSInt32Type for the device location. Using
kCFNumberLongType would cause locations to be sign-extended and not match
what is stored for the session id. This is now fixed.
Add hotplug support to the Linux backend.

There are two ways to configure hotplug support for Linux: udev, and netlink. It
is strongly recommened that udev support is used on systems that utilize udev.
We reenforce this recommendation by defaulting to --with-udev=yes at configure
time. To enable netlink support run configure with --with-udev=no. If udev
support is enabled all device enumeration is done with udev.

References: #17
darwin: allow control messages on devices we can not exclusively open
darwin: dpriv->device will never be NULL for a valid device. remove unnecessary code that handled this case
darwin: clean up extraneous includes
replace removed automake macro AM_CONFIG_HEADER with AC_CONFIG_HEADERS.

Fixes #159. Thanks to cazfi.
darwin/libusb_reset: reenumerate device if the device descriptor or any
configuration descriptor has changed

Some background: the Linux kernel causes a device to be reenumeration when
reset if the device's descriptors have changed. Darwin does not provide
this feature but instead provides a call to force the reenumeration of
a device. This behavior is required to support the firmware update
protocol used by some devices.

This patch updates darwin_reset to check if either the device or
configuration descriptors have changed. If they have darwin_reset will
ask the OS to reenumerate the device and return LIBUSB_ERROR_NOT_FOUND
or LIBUSB_SUCCESS accordingly.

Fixes #169
Don't set the USBFS_URB_SHORT_NOT_OK flag on the last URB.

Fixes: #142