extmod/vfs_posix_file: Lock GIL when writing and allow stdio flush.
extmod/vfs_posix_file: Lock GIL when writing and allow stdio flush.

Also support MP_STREAM_GET_FILENO ioctl.  The stdio flush change was done
previously for the unix port in 3e0b46b9af8b7a6934b7ac68671ef8f55be2b848.
These changes make this POSIX file implementation equivalent to the unix
file implementation.

pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython