Current master (73fc922ed64333d45f18d8a448f30cfa2ae0281e) crashes at the end of processing RPC `gettxoutsetinfo` on OS X:

```
$ ./bitcoind 
Assertion failed: (ok), function Next, file txdb.cpp, line 139.
Abort trap: 6
$ 
```

{
    return pcursor->GetValueSize();
}
bool CCoinsViewDBCursor::Valid() const
{
    return keyTmp.first == DB_COINS;
}
void CCoinsViewDBCursor::Next()
{
    pcursor->Next();
    if (pcursor->Valid()) {
        bool ok = pcursor->GetKey(keyTmp);
        assert(ok); 
    } else {
        keyTmp.first = 0; 
    }
}
bool CBlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo) {
    CDBBatch batch(&GetObfuscateKey());
    for (std::vector<std::pair<int, const CBlockFileInfo*> >::const_iterator it=fileInfo.begin(); it != fileInfo.end(); it++) {
        batch.Write(make_pair(DB_BLOCK_FILES, it->first), *it->second);
    }
    batch.Write(DB_LAST_BLOCK, nLastFile);
    for (std::vector<const CBlockIndex*>::const_iterator it=blockinfo.begin(); it != blockinfo.end(); it++) {
        batch.Write(make_pair(DB_BLOCK_INDEX, (*it)->GetBlockHash()), CDiskBlockIndex(*it));
    }
    return WriteBatch(batch, true);
}
bool CBlockTreeDB::ReadTxIndex(const uint256 &txid, CDiskTxPos &pos) {