Using "who" for not living characters
Solution 1:
If the puppet is actually a "character" with a "friend", as you say, then the story will normally treat it as animate, including by using animate pronouns: "he" or "she" rather than "it", "who(m)" rather than "which", etc.
Solution 2:
I disagree with the first quote in the question.
Who isn't used to ask for a living being, it is used to ask for a person.
- A living person is a person. "Who is the current president of the United States?"
- A dead person is a person. "Who was the first president of the United States?"
- An organization consists of people and might sometimes be considered a person in the legal sense, but not in a grammatical sense. "Which company made your car?"
- An animal is a living being, but it is not a person. "Which horse do you want to ride on?".
- But an animal can be persons when they are anthropomorised to a degree that they gain human-like personality traits. "Who is your favorite My Little Pony?"
- An inanimate object isn't a person. "Which one is your car?"
- But just like an animal, an object can be anthropomorised to a degree that it can be considered a person. "Who is the main character of the animated movie Cars?"
So when the wooden puppet in your story has a human-like personality, thinks like a person, acts like a person and interacts with other people like a person, then it is a person and you can ask for it using who.
Solution 3:
There are many cases in literature, film and folk tradition such as Pinocchio, The Steadfast Tin Soldier, C3PO and R2D2 from Star Wars and even HAL from 2001 a Space Oddyssy where inanimate (or at least robotic) characters are anthropomorphized or given human characteristics. The same applies to non-human characters like Peter Rabbit, Napoleon the pig from Animal Farm and Anansi. As these characters are given human characteristics it is acceptable to refer to them using personal pronouns which would not be used if they had not been anthropomorphized. The reason for the use of anthropomorphism is, almost universally, to make us think about some aspect of the human condition so, in one sense, the characters are human, not inanimate or animal at all which makes the personal pronouns acceptable.