Measurements of the branching fractions of B0→K*0K+K-, B0→K*0π+K-, B0→K*0K+π-, and B0→K*0π+π-