Fix duplicate entry Integrity Error when aborting from AFE

Currently aborting a suite job and its sub jobs from the afe causes
the AFE to spit out duplicate entry errors.

This is do the suite job aborting before a child job does and aborts
the child job. However the model object for that child job has not
been updated so we try to abort it as well and create a new
aborted host queue entry for it but it already exists.

Refactored the logic from abort to a class method that takes in a list
of HQE's to abort. This can be shared between abort and the rpc_interface
code.

BUG=chromium:242040
TEST=Started a suite, did a bulk abort and the error no longer occured.

Change-Id: I0d82506234bac5fea9307b5cd20c836cdf7ccb9c
Reviewed-on: https://gerrit.chromium.org/gerrit/60138
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index f9d17e8..d41d376 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -37,7 +37,6 @@
 from autotest_lib.frontend.afe import models, model_logic, model_attributes
 from autotest_lib.frontend.afe import control_file, rpc_utils
 from autotest_lib.site_utils.graphite import stats
-from autotest_lib.client.common_lib import control_data
 
 def get_parameterized_autoupdate_image_url(job):
     """Get the parameterized autoupdate image url from a parameterized job."""
@@ -591,8 +590,7 @@
     host_queue_entries = list(query.select_related())
     rpc_utils.check_abort_synchronous_jobs(host_queue_entries)
 
-    for queue_entry in host_queue_entries:
-        queue_entry.abort()
+    models.HostQueueEntry.abort_host_queue_entries(host_queue_entries)
 
 
 def _call_special_tasks_on_hosts(task, hosts):