fix windows runtime error while socket closing, fix windows settings directory is registry