Fix python par_loops in conjunction with device backends

We need to explicitly manage moving data from the device and updating
its state.