Cursors housekeeping code looks very messy. We might as well keep this code part of `ExtConnection`. Also, we should limit the number of active cursors.