Simple Spinlock implementation (see
http://kyryloholodnov.wordpress.com/2013/06/08/spinlock-1-2)