thanks for providing this Workaround !
In fact the dlclose() call is not strictly needed - it just seemed to be the clean way of closing opened resources at the end of the program.
Anyways, the next Marlin release will not do it anymore and MARLIN_DEBUG will no longer be needed.