An object's ID is not copied

Fixes JRUBY-7136