Fix data race in TestLogEvent

Found with -race. Improve locking on Server.
Merge pull request #2848 from pnasrat/713-data-races

Fix data race in TestLogEvent