m2mbase: fix a memory leak on object deletion
m2mbase: fix a memory leak on object deletion

The _sn_resource->dynamic_resource_params->static_resource_parameters
was allocated on one constructor, but it was not marked to be deleted
later. Do so and while here, modify free_resources() to follow more
blindly the flags set in the structs.

ARMmbed/mbed-client,tridonic-com/mbed-client,tridonic-com/mbed-client,ARMmbed/mbed-client,tridonic-com/mbed-client,ARMmbed/mbed-client