Add possibility to sync to wait until all work on a buffer is done (can be useful for timings).
Expose the sync functionality to python.