Fixed CID-11031: Dereference after null check

When we don't get a cursor->connection then we always need to bail out,
not matter if we don't have a pregenerated error message
Merged pull request #344