Fix compilation on OpenSolaris 11.

With these changes, druntime can be compiled on OpenSolaris 11 and the unit tests can be run.
Most of tests passes.
Merge pull request #781 from redstar/solaris

Fix compilation on OpenSolaris 11.