Fix crash on database disconnect.

The cleanup of DBClientCursor's needs an active
DBClientConnection. If the connection is deleted
first a method is called on freed memory. Reorder
cleanup so cursors are cleaned up first.

Change-Id: Ia3f27fcb0419fabeb713c26c6a26b4777cc28115