Make PostgresDialect.InsertAutoIncrToTarget return error on failure
Make PostgresDialect.InsertAutoIncrToTarget return error on failure

The function used to return err = nil even if the INSERT statement
failed due to deferred constraits.
It was because PostgreSQL returns such an error after a row for
"RETURNING" clause. So gorp should have read rows until rows.Next()
returns false and should call rows.Err() to fetch the error returned.

How to reproduce the issue
============================

1. Define these two tables

  CREATE TABLE master (id SERIAL PRIMARY KEY, name text NOT NULL);
  CREATE TABLE example (id SERIAL PRIMARY KEY, master_id integer NOT NULL REFERENCES master(id) DEFERRABLE INITIALLY DEFERRED);

2. Try to save an object with auto increment key to example table.
   This should fail because it violates the foreign key constraint.
   But gorp does not return any error.

    package main

    import (
    	"database/sql"
    	"fmt"

    	"github.com/go-gorp/gorp"
    	_ "github.com/lib/pq"
    )

    type Example struct {
    	ID       int `db:"id"`
    	MasterID int `db:"master_id"`
    }

    func run() error {
    	db, err := sql.Open("postgres", "dbname=example")
    	if err != nil {
    		return err
    	}
    	defer db.Close()
    	dbmap := gorp.DbMap{Db: db, Dialect: gorp.PostgresDialect{}}
    	tm := dbmap.AddTableWithName(Example{}, "example")
    	tm.SetKeys(true, "ID")

    	ex := Example{MasterID: 100}
    	if err := dbmap.Insert(&ex); err != nil {
    		fmt.Println("Expected error: ", err)
    		return nil
    	}
    	return fmt.Errorf("Expected an error, but succeeded")
    }

    func main() {
    	if err := run(); err != nil {
    		panic(err)
    	}
    }

yp-engineering/gorp,kimxilxyong/gorp,cortex/gorp,go-gorp/gorp,cortex/gorp,GeertJohan/gorp,yp-engineering/gorp,kevinc0825/gorm,gabelula/gorp,go-gorp/gorp,gabelula/gorp,kevinc0825/gorm,mousesun/gorp,mousesun/gorp,GeertJohan/gorp,kimxilxyong/gorp