Allow building for the WinRT/Windows Phone API subsets

Allow building for the WinRT/Windows Phone API subsets, by avoiding using windows functions not available on these windows variants.