North Korea's mutual defence announcement with Russia comes days after troops had suffered casualties in Ukraine.