Fix case where __module__ attribute is not available on replacement

When trying to patch a regular expression object on a class, monkeypatcher fails on startup because regular expression objects have no __module__ attribute. This should fix that strange case.