Backport of Phobos pull request 2759.

Because of some additional changes it is not possible to cherry-pick the
commit. See https://github.com/D-Programming-Language/phobos/pull/2759.

Implements missing functionality in std.file and std.socket for Solaris.