Today I received a reply from Stephane concerning my problems with the new hamlib debug handler api.
As Stephane pointed out, I was using the API in a wrong way, so the API is all right. He even fixed my buggy test program, so now I can continue with adding this new feature to grig
In case you are interested, you can read the discussion here.