Fix GPU synchronization on mutable ops, and add test