JFR writes old object samples in a safepoint. This is because the heap needs to be traversed to find paths to the gc roots. Due to the overhead, the path to gc roots functionality is disabled in the default configuration - only object class, thread and allocation timestamp are written.
Still, the code runs in a safepoint, albeit a very short one. It would be possible to eliminate the safepoint (unless the heap is traversed) and instead take the allocation sample lock to prevent the object samples list to be modified concurrently