Avoid sending old messages to clients, lock for monotonic ids.
Avoid sending old messages to clients, lock for monotonic ids.

When failing over to a different server, clients might have seen a more
recent message than the target server, so avoid sending old messages.

For this to work reliably, we MUST make sure that message IDs are
strictly monotonically increasing, for which commit 1ddb64832 was not
sufficient — there was a race condition between the creation of a
message and commiting it. The locking in this commit addresses that.

fixes #94

robustirc/robustirc,robustirc/robustirc,robustirc/robustirc