Fix Issue 6644 - std.stdio write/writef(ln) are not @trusted

https://issues.dlang.org/show_bug.cgi?id=6644
More discussion here: http://stackoverflow.com/questions/19101305/how-can-i-do-i-o-in-safe-functions-in-d

Changes I have made to get `write` and family callable from `@safe` code:
  - Made `LockingTextWriter` and factory function `@trusted` - I didn't see anything inherently unsafe about the way it manages the lock. I'm certainly open to correction, though.
  - Wrapped the `stdout` global variable's usage in a `private @trusted` property that is used by `write` and friends. If this is not done they always infer to `@system` due to accessing a global variable. I'm not 100% sure this is safe to to, but with the property being private all external use of the global will still be `@system`.

This is much like https://github.com/D-Programming-Language/phobos/pull/2230 except it does not use free functions - after more testing I found they worked fine as member functions. This is a separate pull request because I'm terrible at git :/


I thought so too, except the original line (`stdout.write(args)`) gets infered as `@system`.  A small test program also explicitly fails due to `@safe` not being able to use globals:

```
import std.stdio;

__gshared int i = 47;

@safe void main(string[] args) { print(i); }

@trusted void print(int v) { writeln(v); }
```

produces `main.d(5): Error: safe function 'main' cannot access __gshared data 'i'`