Permutation tests from biased samples for the equality of two distributions