Upvote:2
You can return to the US under the VWP as soon as your B-2 visa expires. You can't use the VWP while you have a valid visitor's visa (source: https://esta.cbp.dhs.gov/esta/), nor is there any reason why you'd want to. While your B-2 visa remains valid, you can enter using that, which has fewer restrictions than the VWP.
In both cases, a three-week visit soon after a five-month visit is probably fine. You may be asked to show evidence that your visit is truly going to be short, and the working holiday visa should be helpful with that.