Fix debug message relative display on wrapper

This issue was caused by the print("[#] foo") was not
appending "\n" to the end of the string before printing,
but doing a second write. That's why we needed to add
a lock token for the cases where debug message shouldn't be shown.
Full rewrite of plugin loader errors behavior