General relativistic radiation hydrodynamics of accretion flows - I. Bondi-Hoyle accretion