Replace khash with maps in couch_event_server

Noticed when debugging an OTP 25 memory leak that couch_event_server didn't
behave well when the system was overloaded. It blocked and prevent even process
info inspection or is_alive checks:

```
> s:pinfo(whereis(couch_event_server)).
...blocked...

> erlang:is_process_alive(whereis(couch_event_server)).
...blocked...
```

Added almost 100% test coverage for the couch_event_server module.
2 files changed