Low-level logic copied from curl, and adapted to libssh2.
Also: use secure fopen CRT functions.
Credits-to: Jay Satiro
Credits-to: Viktor Szakats
Closes#2318
Introduce and use the local name `ssh2_snprintf()` instead, and map it
to system `snprintf()` when safe, otherwise directly call the local
implementation already using this name.
Also: adjust checksrc rules.
Closes#2103
Replace with `ssh2_deb()`.
Also:
- adjust checksrc options to verify.
- checksrc-all.pl: fix an issue preventing picking up `tests/.checksrc`.
Follow-up to c090b696c6#1556
Follow-up to af1e591eee#796Closes#1997
To reduce differences with curl.
Also:
- add most scripts to the source distro tarball. Some were referenced
by build scripts (e.g. `checksrc`).
Closes#1870