Fix a few static code analysis warnings 

[src/MenuInventory.cpp:798]: (style) The scope of the variable 'bonus_counter' can be reduced.
[src/MenuInventory.cpp:800]: (style) The scope of the variable 'item_id' can be reduced.
[src/MenuInventory.cpp:868]: (style) The scope of the variable 'item_id' can be reduced.
[src/MenuNPCActions.cpp:47]: (performance) Variable 'id' is assigned in constructor body. Consider performing initialization in initialization list