Fix error path in read_ctable_from_sql
Fix error path in read_ctable_from_sql

If the pg_exec done by read_ctable_from_sql failed then the proc would trace back due to trying to clear a postgres result that didn't exist.  This has been fixed.

Also the proc has been slightly spruced up and modernized.

flightaware/speedtables,flightaware/speedtables,flightaware/speedtables,flightaware/speedtables