There's some racy behavior when closing a MongoClient although I'm not sure it causes any problems. A closed monitor thread may update a closed Topology. The situation is:
1) Topology is closed.
2) Monitor is closed in the middle of an isMaster check.
3) Monitor thread finishes isMaster check and calls Topology.on_change.
4) Topology is updated while closed, possibly creating and opening new Servers.
A possible fix might be to make Topology.on_change a no-op when closed.