Make deletion of repl buffer more robust

The repl buffer may have been closed before the process buffer.
Clean up the connection list functions

Puts all access to nrepl-connection-list behind functions.
Add tests for connection list functions