Is there any trick to have my pet bat not aggro stuff? I've lost plenty of treasure goblins this way. I think this is so stupid (it should start hitting it -after- me)...
The one thing that you can do is re-summon the pet. This will cause it to warp back to you, giving you enough time to back up so it does not attack. With companions you can dismiss them if you see a treasure goblin. This is also a lot easier with the Templar since you see him run to the treasure goblin, compared to the other range companions. But there is no other way to put them on "hold" sadly.
The same thing happens with companions (incidentally, this is half the reason I don't use one; the other half is the inane conversations). There's no real way to control them, other than give the treasure goblins a wider clearance than you otherwise would. The other solution is to simply use a different skill if you don't like the way your pet works out.
Regarding treasure goblins specifically, it is possible to herd them. If you can use vault or other skills to get onto the other side of them, you can push them back the way you have come and away from other enemies rather than chasing after them and pushing them deeper and deeper into more enemies which you will then need to kill. In single player at least (may not work as well in multiplayer) goblins will always run away from you, not your pets or companions.