Fix race condition in serverlog()

This function would sometimes fail to output one or several lines
of server log output when CONDITION was a pattern to match.