Polarized photoproduction of heavy quarks in next-to-leading order