Add destroy to a task's allowed_operations

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Move task_status_is_completed to TaskHelper

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>

Conflicts when merge to clearwater-sp1-lcm:
	ocaml/idl/ocaml_backend/taskHelper.ml
	ocaml/idl/ocaml_backend/taskHelper.mli
	ocaml/xapi/db_gc.ml

Signed-off-by: Zheng Chai <zheng.chai@citrix.com>
Don't destroy tasks that aren't complete

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Merge pull request #1851 from Zhengchai/clearwater-sp1-lcm

HFX-1174: CA-130821 - better handling of Task.destroy API