A kernel test for quasi-independence