Make std.stdio.LockingTextWriter.put and lockingTextWriter @safe

We can mark `std.stdio.lockingTextWriter` as safe because the constructor of `LockingTextWriter` is safe.

`LockingTextWriter.put` for ranges uses `core.stdc.stdio.fwrite` but we can verify it can be trusted.
`LockingTextWriter.put` for char type uses `FPUTC` and `FPUTWC` but we can verify they can be trusted.
I define nested trusted functions for them.
As they don't depend on anything in the function scope - mark them static?