Add pauth_tool source

Thanks @tpunix share it
Add compiled file
Fix another race condition.

If EVENT_FINISH is received, but coreState is still CORE_RUNNING and the
thread is still enabled, it would hang.  Makes more sense to wait for
events before processing them anyhow...
Unlock reslts before scheduling.

To prevent deadlock while debugging with events all running sync.
Fix IsOnSeparateCPUThread(), was always false.

Erp, because of detach().
Fix hang on stop before run w/ multithreading.

And clarify logic.
Eat a few more cycles on END cmds.

Fixes #3049, which apparently expects an END/FINISH to not immediately
trigger (it drawsyncs soon after, and completely expects that to
reschedule.)

Either way, it seems plausible an END would take a few more cycles than
most instructions, since it generates an interrupt.
Merge pull request #5988 from unknownbrackets/gpu-minor

Eat a few more cycles on END cmds
Merge pull request #5987 from unknownbrackets/multithread

Fix another race in multithread, and ge sync
Merge pull request #5982 from sum2012/pauth_tool

Add Pauth tool