[CUDA] Move command finalization to background thread
[CUDA] Move command finalization to background thread

This simplifies a lot of the code for handling command
finalization. It also makes the CUDA backend more consistent with the
other device drivers, in that commands no longer need to explicitly
check their own dependencies, the broadcast/notify approach is used
instead.

Oblomov/pocl,Oblomov/pocl,franz/pocl,Oblomov/pocl,rjodin/pocl,Oblomov/pocl,rjodin/pocl,pocl/pocl,franz/pocl,pocl/pocl,franz/pocl,pocl/pocl,franz/pocl,rjodin/pocl,pocl/pocl,Oblomov/pocl,pocl/pocl,franz/pocl,rjodin/pocl