Allow display of objects that override attrs

The BeautifulSoup library overrides object attributes such that `haskey(o, :anything)` always returns true.  This simply adds a check in mimewriteable to make sure that `o[$method]` is not `None` before trying to call it.

I am not a Python programmer, so I do not know how common or accepted this idiom is.  But it makes BeautifulSoup objects behave better.