Measurement of branching fraction ratios for B+ -> D*+D-K+, B+ -> D*-D+K+, and B-0 -> (D*-DK+)-K-0 decays