Study of 16O(d, d)16O and 16O(d, p)17O using polarized deuterons