Set the connection async earlier in green mode

The moment it is called shouldn't have really changed, but it's more
explicit when it happens. Previously it was sort of obfuscated behind a
roundtrip through the green callback and poll.
Set the connection async before polling for connection

It should fix ticket #194
Bug #194 confirmed fixed: newsfile updated.
Merge branch 'ticket-194' into maint_2_5
Use the do-while 0 idiom for cursor guards macro
Don't segfault on uninitialized cursor

It can happen with bad cursor subclasses not calling super's init. Raise
an exception instead of segfaulting.

Closes #195