Fix pets lagging behind and despawning

Fix pets lagging behind and despawning by slightly adjusting speed based
on distance to owner.

Closes #8740