Correct close() function when building with MSVC