testlib: fix small leak to shut up valgrind
cuda: use device buffers with memcpy instead of mapped host memory. Speedup observed ~x10, to 13ms/frame at 1024x1024 on my machine.