Three inmates injured in NSW prison brawl