Fixing error in CoAP to enforce that the last resource linked list has next element set to NULL