Atomically reads and updates a TVar using the given function f.
Example:
val counter = TVar.new(0)val newValue = counter.modify { it + 1 } // 1
the new value after applying f
a transformation function applied to the current value