Add attributes to `std.socket`

`std.socket` now has `@safe` public API.

Also added few fixes.
Is this a valid way of adding nothrow when writefln can throw?