Closed-loop optogenetic control of the dynamics of neural activity in non-human primates