Josh Thewlis ended a good piece of play by Warrington Wolves to give his team a late lead over Catalans Dragons.