Correctly lock ufo_buffer_copy