Check __doc__ before change it.

This allows to use Wand when Python is invoked with the -OO flag.