[lib] fix a bug in destroy_vms