Changes for SPI bus locking appear to work.

* Added new WRITE states - REQUEST and PERMITTED so that the CC3000 SPI select
and unselect calls are called from the same thread - otherwise by the nature
of mutex ownership it won't work.
* Replaced binary semaphore with counting semaphore. Looking at it, it would
seem there was the potential for a binary semaphore to miss a signal.
* Added a function to permit some state change debugging.

Still needs prolonged testing and documentation updates.