Move yield to the tests and enable for FreeBSD

Move the definition of git_thread_yield() to the test which needs it and
add the correct definition for it for FreeBSD and derivatives.

Original patch adding FreeBSD and derivatives by @jacquesg.
Merge pull request #2460 from libgit2/cmn/sched-yield

Move yield to the tests and enable for FreeBSD