peripheral_manager: Fix warnings, clean up code
Fixed warnings issued by host and target compiler. Fixed warnings/errors issued by cppcheck. In order to fix issues reported by cppcheck inline-suppression was used as cppcheck does not understand that a macro initializes a variable (list_for_each_entry).