Fix two test bugs. Split CLIClient#main() into two parts, one for
testing with no call to system.exit(), the other for live system, which
does call system.exit().

Als add verify that e.getSQLState() returns a valid SQL State code.