forked from Imagelibrary/lwip
FIN should only be reported once (as '0' for sockets, as 'ERR_CLSD' for netconns). Before this change, ERR_CLSD was returned forever... This is the 2nd try. First try (commitebcae98ae6) was buggy in that it could drop the FIN if it was read together with data (reverted in commitebcae98ae6). This version fixes this by adding an apiflag and a netconn flag to keep track of this.