Patch fixes the problem of loss events call disconnect and close the connection stack lwip. Many thanks to PV.

Signed-off-by: Mikhail Grigorev <sleuthhound@gmail.com>