Collaboration and Conflict between Humans and Language Models through the Lens of Game Theory