Semileptonic and nonleptonic decays of B c mesons to orbitally excited heavy mesons in the relativistic quark model