Fix win32 linking and run test automatically in AppVayor