cache dup logic to speed up Gem::Specification#initialize