Fixed Modbus/TCP Gateway to change the way it frees up memory.
Improved the way the serial server avoids potential lockup problems.