classic-ui: fix possible buffer overflows #5250

Add checks to functions using strcat. Now the legth of the resulting
string gets calculated and checked if it would exceed the max length
for this char array.

Thanks to DTAG Group Information Security for the findings.

backported to 1.8

refs: #5250
whatthecommit: fixed my stupidness ...
classic-ui: fix Off-by-one memory access in process_cgivars() #5251

Wrong increment in process_cgivars() got removed.

Thanks to DTAG Group Information Security for the findings.

backport to 1.8

refs: #5251
whatthecommit: Obligatory placeholder commit message
update version to 1.8.5