SPI transfers longer than 255 bytes fail due to use of 8-bit counters

SPI_writebytes(), SPI_xfer() and SPI_xfer2() have a declared maximum transfer length of 1024 bytes, but each function uses 8-bit counters to iterate over the buffer (uint8_t  ii, len;) which effectively limits the transfer length to 255 bytes.  Using 16-bit counters solves the problem.

I have verified the fix to SPI_writebytes() with hardware.  Changes to the other two functions are by code inspection only.