Add testing of changing buffer numbers and sizes.
Change default buffer size to 8k for above.
Also check if the thread is still running while benchmarking (device disconnect for example terminates it).
- Handle events at shutdown as needed.
- Validate input to constructors as much as possible.
- Check that transfer and buffer are not null when creating them.
- Make submitting and adding the new transfer to the global list an atomic operation (by locking).
- Check return values of submitTransfer and cancelTransfer and act accordingly.