tests: Add a new test for getLastError()

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
mongo-sync: When verifying a command result, verify better

When verifying a command in safe mode using
mongo_sync_cmd_get_last_error(), when determining the result of the
verification, make sure that getLastError() itself succeeded. Relying on
the returned error being NULL is not enough, as getLastError() itself
can fail too.

Reported-by: Andras Mitzki <micek@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>