I have the very same bug since today. Same procedure same problem.
I have also put my pet to the stablemaster as I wanted to tame me a new one.
On the way I got an alterac invite and took it.
I'm ever since stuck with an uncontrollable, useless pet that I can not teach anything and not delete... If gm's could just delete it I would gladly take that deal.
It's not too many hunters having that particular problem apparently so.....
SOLUTION to the problem:
Type /script PetAbandon() in your chat, it should abandon your current one. Worked for me.