spi: fix use-after-free of the add_lock mutex