Add hid_write_timeout per issue #198

This extends the API with an `hid_write_timeout` function that allows an early exit in the event of a write failure (usually caused by devices failing to respond correctly).
I'm not sure this is the right approach.  If there's a timeout, the thread is left running in the background -- meaning that the write will likely eventually succeed.  I think the semantics of hid_write() are that it is supposed to either succeed or fail.  I extrapolate that for hid_write_timeout() to be that the write should either succeed, fail, or timeout (not timeout and then eventually succeed without you knowing).

Know what I mean?

Perhaps you should pthread_cancel() the thread after a timeout...?

(I don't know anything about OS X programming, either, so I don't have any better suggestions :-( )