Optimal feedback control in first-passage resetting