clang-format, doc: Add guidelines for comments in closing braces and fix code accordingly
Add guidelines for comments in closing braces. Fix ns-3 code according to these guidelines, either removing ending comments or moving useful comments to separate lines.
This MR is part of the roadmap to enable support of clang-format-18 and beyond, which is tracked in !1899 (merged).