Fix broken duplicate handler detection.

The old logic is broken (at least with newer versions of Python).  New
handler objects are created, and there is no mechanism for comparison,
so it resorts to using the object id.  This means that duplicate
handlers are not detected at all.  Let's check the baseFilename of
FileHandlers and the stream attribute of StreamHandlers as a way of
detecting duplicates instead.

With this change, the repeated log messages are greatly reduced.