dap_run() function
Perform all queued DAP operations, and clear any errors posted in the CTRL_STAT register when they are done. Note that if more than one AP operation will be queued, one of the first operations in the queue should probably enable CORUNDETECT in the CTRL/STAT register.
Return value
ERROR_OK for success, else a fault code.