Make module attribute setting more forgiving.

Some libraries will raise all types of errors for modifying things. It
seems that the only safe way to do this is to catch all exceptions.