Modify binomial/multinomial logistic regression python codes to solve the
performance degradation caused by the disabling of INDEX support in GPSQL

We have tried to use TRUNCATE TABLE to keep only the last record, but it still
cannot solve the performance problem because after many truncations, the time
need for each iteration becomes very slow.

Thus we decide to keep the result from the last iteration in memory, instead of
using (TEMP) tables. As we don't need to parse the states in python codes, we
use plpy.prepare to prepare query plans and pass the states as python objects
to avoid memory overconsuming problem.