pegbox: semaphore: Fix race condition in down()

We were pre-emptible between unlocking sem->lock and calling sched_sleep(),
 which lead to the process getting added to both the runq and sem->waitq.
Add a CLI/STI around down() to prevent this.
pegbox: A bunch more fixes to CLI/STI usage.  Now seems to be correct

The only lockups I'm seeing now (on -p 5) are with -c31 and -c32, and at
 that point it's as likely as not due to bus starvation.