Killing and harming are against the first precept. I understand that an important part of the practice is being mindful at the time of death, but do animals have this capacity? Would it be better to end their suffering if they are dying anyway? I saw an animal suffering on the way home and this came to mind.
The precepts are frequently understood from a a Western perspective as "do not [kill]", similar to "thou shalt not ..." as in Christianity. However, this type of dualist view (either one or the other, right or wrong) is not taught in Buddhism. Therefore, the key in translation of the precepts to
"undertake the training to refrain/abstain from [...]" (related question).
The difference may appear subtle, but whereas undertaking the training to abstain from killing means an avoidance whenever possible, the "do not do this" view can imply don't do it, or else ... - and if broken, one will be punished or similar.
Also related to killing oneself (related question), since each of us is a living being, killing oneself is on par with killing other beings - Buddhism very much equates all living beings (animals, humans, self, other) as just living beings, worthy of compassion and therefore worthy to be kept alive (not killed).
However, this is a practice/training we undertake, and we undertake the intention to act kindly and compassionately towards all living beings. The importance lies in cultivating the wisdom to tell the difference in each moment, and so an action of killing could be performed despite one's full awareness of the resulting karma, simply out of compassion for a living being (ending suffering, would be the supposed intent).
Although not with animals, but related to the precept, even the Dalai Lama agreed that it was reasonable to kill Osama Bin Laden, saying "if something is serious … you have to take counter-measures". We can each have our own view on that (read article), but the point is to apply mindful wisdom and compassion in each situation.
In summary, undertaking the training to abstain from killing, along with the other precepts, were established by the Buddha to help people act as the Arahants do. Without having attained Arahantship, the best each of us can do is practice to the best of our abilities, in each moment.
Being mindful all the time is an important part of the practice. Not just at the time of death. But if you have a wholesome thought at the time of death, your next birth will be better.
Whether it's human or animal, what makes you think killing will relieve a being from suffering? It could be born in a worse place. Your action is based on a big assumption or at worst, annihilationism.
In any case, if killing ended suffering, Lord Buddha would have preached it as the fourth noble truth, instead of the noble eight fold path. :)