Fixes C Examples & Add Timeout Support

I was using this on my device a few days ago and I ended up tidying up a few things on my local copy.
This resolves some issues with device timeouts and much better (IMHO) errors are printed out when something stupid is done at connection time. The issue with multiple valid device ids is not fixed here, though it looks like that was solved some time ago in the python version.

Thanks for the effort put into getting this driver working in the first place.