Special weak Dirichlet processes and BSDEs driven by a random measure