stmhal: os.sync() [apparently] doesn't flush FatFS read buffers
My time to ask dumb questions. I created a new file on pyboard's internal flash over USB mass-storage . Expectedly, it didn't show up. I issued sync on Linux side, it didn't show up. I unmounted filesystem, and it still didn't show up. I issues os.sync() on pyboard, and it still didn't show up. I had to reboot pyboard to get hold of it. I'd say, unmounting mass-storage and os.sync() should be 100% enough.
extmod/moduos.c: Move the sync() method code into extmod/moduos.c.
Avoiding code duplication and making it easier to enable it for ports. os.sync() was already available for the ports STM32, Renesas and nrf. The implementation for STM32 and Renesas is replaced by the common code, and os.sync() is now available in the ESP32, ESP8266, RP2, MIMXRT and SAMD51 ports. These provide FAT support, and os.sync() is only useful for the FAT file system.
The code size increase is about 56 Bytes.