I believe removing the lock altogether would be fine, as fwrite has its own lock on most platforms. If we ever want to run in a platform with thread unsafe I/O calls in the C runtime, we'll have no choice but to lock both. I think it is unlikely that we will (famous last words).