pio: assorted improvements to flash handling code

Make the code more reusable.
Check the flash device ID and print a warning if it doesn't match.
pio: make flash reading code reusable
libpixi: add pixi_fileRead()
pio: add flash-write and flash-erase