Measurement of charm and beauty dijet cross sections in photoproduction at HERA using the H1 vertex detector