Stubbing a method on any_instance_of(SomeModule) gives spurious error about prepended modules

Fixes #781 (in 3-1-maintenance)