SERVER-10084 Make LogstreamBuilder safe to use during static init; fix memory leak.

Fixes mongo/logger/log_test unit test on OS X.