lib/cgi/*.cgi: Fix some security issues.