Adapt RED Brick API to changed error reporting
Add abort_async_file_read() function to RED Brick API
c: Fix race condition between device destruction and callback dispatch

A call to device_destroy() could destroy a device object while the
callback thread was dispatching a callback to it. This could also happen
in the receive thread.

Add a reference counter to the device object and make the callback and
receive thread hold an extra reference to the device object while they
are using it.