Fix device adapter algorithms for small arrays
There were some issues for device adapter algorithms (like scan and reduce) for empty arrays or arrays of size 1. This adds tests for these short arrays to the device adapter algorithm tests and fixes these problems.