Fixed most of the cppcheck errors in src/opentld