Add attributes to `std.socket`

`std.socket` now has `@safe` public API.

Also added few fixes.
Surely, rebased. I also remember I did it but probably lost this change in the pull. (