One update changed several places
When an update path was a prefix of an earlier one, getpath handed the update function a value from the allocator, which it could store in several places. The query (.a.b, .a, .a.p.z) |= {p: ., q: .} added "z" to both .a.p and .a.q, while jq adds it only to .a.p.
A value that escapes gets copied
A new funcGetpathWithAllocator releases the allocator when it hands out a value the allocator created, so later updates copy it. Two tests in cli/test.yaml cover overlapping paths, nested ones included.