debug: Fix linking failure on OS X by keeping debug level symbol internal

This change keeps the debug level symbol within the internal convenience
library and makes it accessible using an internal helper. This fixes
linking, prevents new exported symbols and finally allows proper control
of enabling debug messages.