my advice, try rebooting your computer and then doing another scan with the kaspersky program.
the scan-log showed that it couldn't remove the infection from memory, which suggest that it was running, which was why it was in memory. when a program is running, it is locked.
hopefully, after rebooting, the malware that was running in memory will be gone. the scan-log showed that the KMS-file itself was removed, so it shouldn't be running anymore after rebooting the computer (if the KMS file actually was removed). it is possible that something went wrong and the KMS file was not actually removed-since it actually was running in memory, so the file could have been locked, and, so, couldn't actually be removed.
as for the avast program's not flagging the KMS file, my guess is that you have the avast program set to ignore the file. as pondus pointed out, KMS files are used for pirating software, so you probably would want the avast program to ignore it, so that you could use it to pirate software.
KMS files are not ignored by antivirus programs. in fact, it is the number one thing that the windows defender antivirus program flags:
https://www.microsoft.com/en-us/wdsi/threats("keygen" files are similar to KMS files in that they also are used for pirating software)
i can tell you, the avast program has a very good detection-rate for detecting malware. over the course of the past 20 years, several times, i have seen the avast program flag malware before any other vendors were flagging it.