Fix minGW sprintf_s build error

On windows, We should replace snprintf on msvc only.