MB-9128:  write debug messages to STDERR only if DEBUG is True

Change-Id: I5f93d16fae09c23024c6a55012e743c2594405ca