Firstly: Halsin
Plus he could have gotten out much sooner from the goblin camp, since he seemed to know, that things are not good at the grove. All that makes him look a bit incompetent to be honest.
He doesn't WANT to get out though. Not until the Goblin Leaders have been dealt with. That's literally why he stays there if you free him, he literally says he won't leave until the Goblin Leaders are dead.
His whole "Turn into a bear and get captured" thing was part of his plan. He wanted to be kept there so he'd have time to formulate a plan to take out the leaders. Yes, he could leave at any time (Not only by turning into a mouse, but he also shows he can bust down the door to his cell without issue), but his concern is to protect the grove by removing the goblin threat.