minor license, header end comment etc. cleanup in /script

- ensure all licenses are just MIT
- add a missing header end comment
- ensure alphabetical ordering
fix a lock indentation in main.cpp

- also ensure alphabetical ordering in file header
Merge pull request #5049

4dc5eb0 fix a lock indentation in main.cpp (Philip Kaufmann)
5eed8c2 minor license, header end comment etc. cleanup in /script (Philip Kaufmann)
Prettify JSON tests and minimize diffs