Fix 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
Merge pull request #596 from stefanbeller/master

Fix a few static code analysis warnings