Feedback control guides credit assignment in recurrent neural networks