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).