`Extract#as` should not mutate the receiver

Fixes https://github.com/rails/rails/issues/16913
Merge pull request #312 from tamird/5-0-stable

BACKPORT: `Extract#as` should not mutate the receiver