Introduce support for callback functions

I've a device which implements custom modbus functions. Receiving the response for this functions is only possible when libmodbus knows about the response length. As various device could implement the same function codes its up to the program using the modbus library to calculate/provide the response length correctly. So this two patches are a RFC to deal with such situations.