examples: check the value returned by libusb_init()

Problem detected by the Coverity tool
CID 1042538 (#1 of 1): Unchecked return value (CHECKED_RETURN)4.
check_return: Calling function "libusb_init(libusb_context **)" without
checking return value (as is done elsewhere 11 out of 12 times).
examples: check the value returned by libusb_handle_events()

Problem detected by the Coverity tool
CID 1042539 (#1 of 1): Unchecked return value (CHECKED_RETURN)8.
check_return: Calling function "libusb_handle_events(libusb_context *)"
without checking return value (as is done elsewhere 6 out of 7 times).
examples: check value returned by libusb_bulk_transfer()

Problem detected by the Coverity tool
CID 1042540 (#1 of 1): Unchecked return value (CHECKED_RETURN)1.
check_return: Calling function "libusb_bulk_transfer(struct
libusb_device_handle *, unsigned char, unsigned char *, int, int *,
unsigned int)" without checking return value (as is done elsewhere 4 out
of 5 times).
tests: set output_file to a valid value

If fdopen(3) fails then ctx->output_file is NULL and should not be used
in cleanup_test_output() called next.

Problem detected by the Coverity tool
CID 1042543 (#1 of 1): Dereference after null check (FORWARD_NULL)9.
var_deref_model: Passing "ctx" to function
"cleanup_test_output(libusbx_testlib_ctx *)", which dereferences null
"ctx->output_file".