Measurement of branching fraction ratios for B + → D *+ D − K +, B + → D *− D + K +, and B 0 → D *− D 0 K + decays