Cursor success/failure handling.

@michaelcahill, here are the changes we discussed as remaining work for issue #607.

This passes the test suite, "make check", and smoke runs of both format and wtperf, but it needs careful review.

I'm going to add some comments in the diff to try and point out the changes I think are most likely to be wrong.