Law: do not kill. Machine kills. It has broken the law, and would, presumably, be subject to asset seizure, temporary deactivation, or, in extreme cases, permanent termination. Much like
how other 'persons' break the law and are held accountable.
Without a change in law, I don't see it. The owner or manufacturer of the machine is liable; they're subject to the law and prosecution. The machine could "suffer" the actions you describe, but that would be at most punishment against the owner, or more neutrally just removal of a hazard.
Guns and cars aren't prosecuted for murder. I'm assuming autonomous cars won't be either.