Dijet angular distributions in direct and resolved photoproduction at HERA