Make shiftreg value updates atomic, properly abort SPI transmission when restarting (possibly fixes issue #1)