Add braces to single line statements in src/shared

This PR fixes the coding style in the src/shared folder.
Note that this only includes adding braces to single line statements, since also changing to strict equalities/inequalities is much more difficult (because of the risk of implicit type conversion in the current code).