Split up `Exchange.notifyLoop()`.

Use mutexes to protect the endpoint and latency maps.