all pios_spi: check device in non freertos env and remove redundancy

Remove some code redundancy and check the device when not building using FreeRTOS as well.