Fixing windows file mapper master

Various fixes for the windows server support.

@karlitschek @Raydiation @icewind1991 @bartv2 THX