libdialog: Increase MAX_LEN to 4096 (bug 2480)

While we are waiting for new libdialog, improve the ancient one so that
it at least doesn't core dump when used (e.g. ghostscript9 in dports)