A terminally ill rescue dog became a police K-9 for a day