As I've said before (in 13893225), the MAKE_CONST_STRING variants make no sense in a module initialization function. They keep a cached copy of the string around to use the _next_ time the code is run (hence the extra ref), but the initialization function is only run once, so the _is_ no next time. So the extra ref, and the static variable to hold the cache, and the test so see if it was already initialized, are _all for nought_. Simply change
MAKE_CONSTANT_SHARED_STRING(a[i], "somestring");
to
a[i] = make_shared_binary_string("somestring", CONSTANT_STRLEN("somestring"));
and you'll get better code, and no trouble from dmalloc.