Make file objects as thread safe as the underlying libc FILE* implementation.