SERVER-10172 Refactor RamLog to make it thread-safe.

Also prevent accidental creation of duplicate ramlogs of the same name.