Anticipating synchronization through optimal feedback control