Mechanism of DNA resection during intrachromosomal recombination and immunoglobulin class switching