pkg/libcoap: fix build AND tests: add one to ensure it does not break in the future

Regarding a. and b. feel free to open a fresh PR, but maybe we can fix the problem with the current pkg now, so people interested in using it (compare mailing list) can do so without hassle.