Proper atomic test-and-set spinlock implementation

Also updates spi_controller to use new spinlocks.