Fix fold so it can be nested

This fixes a couple bugs in `fold` and company:

 * `fold` can't be nested, since it simply uses cursor name `fold`, leading to a conflict when `fold` is already in progress.

 * If a SQL error is thrown from `fold`, it will lose the original exception to "current transaction is aborted, commands ignored until end of transaction block".

I almost considered releasing a `Database.PostgreSQL.Simple.Cursor` module (see [my cursor branch][1]).  I'm not sure it's worthwhile, though, at least not in its current form.

 [1]: https://github.com/joeyadams/postgresql-simple/tree/cursor