Make proper use of hidapi function return values.