I think the previous poster did the RIGHT thing in slightly closing the throttle. What he probably did wrong was not counter-steering hard enough and maybe not looking where he wanted to go. The reason to not abruptly close the throttle or hammer the brakes when you are leaned over is that either will shift the weight forward which may cause your rear tire to slide out and low-side you.
The OP we are commenting on figured out for himself how he could (and should) have avoided the situation. But we all make mistakes. Best to REALLY understand (and safely practice) these physics so, if we have to, we do the right thing.