Upgraded libmodbus to version 3.1.1

Upgraded libmodbus to latest version 3.1.1.