Add FIONWRITE to allow applications to sniff the amount of writable space on a descriptor. Implement this for serial devices only.
Fix the handling of FIONREAD/FIONWRITE; thanks Tridge.