Libmodbus update

OK, I have done a PR against libmodbus https://github.com/stephane/libmodbus/pull/213
This PR contains all upstream changes plus the changes from the PR above.