Don't modify pass-by-value copy of opts on module refresh

This probably quietly broke a lot of other things with multi-master but
the issue in question is #10900

Closes #10900