More @safe-ty for core.sync

This will be needed for safe-ization of std.experimental.logger

Please pay special attention to version(Windows) parts as I don't have enough
knowledge about it to be sure that trusted stuff there can indeed be trusted.