Cleanup gitformatpatch.sh script.

This patch cleans up gitformatpatch.sh:
1. Adding copyright notice
2. Re-order functional blocks
3. Formatting help message and fatal errors
4. Enhance sanity checks
5. Enhance patch generation verbosity
No functional changes.

Signed-off-by: Lv Zheng <zetalog@gmail.com>