Hi!
1. Blender solution:
Try to run task command in a console w/o Afanasy.
Will it be the same result?
If so, you can ask on Blender forums, why the command does not finishes after render was finished.
2. Afanasy solution:
If some command produced 100% result and does not quits, it can be terminated by Python parser class automatically:
https://cgru.readthedocs.io/en/latest/a ... false-true
It is much better to fix program to make it exit itself, to let it to perform all needed actions before exit.
Abnormal program termination is just a trick that can be used it all other ways don't work.