Add attributes to `std.socket`

`std.socket` now has `@safe` public API.

Also added few fixes.
That's a bug with `writefln`, it's going to be safe in the future. Please add a link to a bug report so this workaround can be removed when the underlying problem is fixed.