spi: Fix potential NULL pointer dereference in spi_shutdown()