Eric Dupond-Moretti, du prétoire au gouvernement