I always try to log out at least 10 minutes before the top of the hour when shard maintenance is supposed to occur. I don't quite trust the auto-stable feature for the big multi-tile pets, so I always try to make sure those big pets are stabled before I am going to log off their owner for more than just a few minutes.
Also, don't forget that pets with something in their pack do not auto stable at all, other than mounted giant (blue beetles). And if you log out riding one of those giant beetles after the server has done its last back up before maintenance and it has something in its pack, it will likely not auto stable and will start to wander around after the server comes back up. If you don't log on with the owner before it goes wild, the contents of the animal's backpack drop to the ground in a backpack when it goes wild and anyone can pick up the backpack (assuming it isn't in your house).