Efficient permutation P-value estimation for gene set tests