DreamSync: Aligning Text-to-Image Generation with Image Understanding Feedback