Fix IMCS context cleanup bug in case of nested SPI calls