Opening two of the same wallet (tested in v0.18.0 of bitcoin-qt 64 bit) will cause a database collision, and will crash the program.

`[marshall@likon] {21:21} [~] $ bitcoin-0.18.0/bin/bitcoin-qt `
`terminate called after throwing an instance of 'std::runtime_error'  what():  BerkeleyBatch: Can't open database 8204388-wallet.dat (duplicates fileid 8b1c090000000800e25686350000000000000000 from 1352491-wallet.dat)`
`Aborted (core dumped)`

I have been able to reproduce the issue by importing two of the same wallet (with different filenames).
{
    if (pwallet == nullptr)
        return 0;
    
    bool allow_cache = (filter & ISMINE_ALL) && (filter & ISMINE_ALL) != ISMINE_ALL;
    
    if (IsImmatureCoinBase())
        return 0;
    if (fUseCache && allow_cache && m_amounts[AVAILABLE_CREDIT].m_cached[filter]) {
        return m_amounts[AVAILABLE_CREDIT].m_value[filter];
    }
    bool allow_used_addresses = (filter & ISMINE_USED) || !pwallet->IsWalletFlagSet(WALLET_FLAG_AVOID_REUSE);
    CAmount nCredit = 0;
    uint256 hashTx = GetHash();
    for (unsigned int i = 0; i < tx->vout.size(); i++)
    {
        if (!pwallet->IsSpent(hashTx, i) && (allow_used_addresses || !pwallet->IsSpentKey(hashTx, i))) {
            const CTxOut &txout = tx->vout[i];
            nCredit += pwallet->GetCredit(txout, filter);
            if (!MoneyRange(nCredit))
                throw std::runtime_error(std::string(__func__) + " : value out of range");
        }
    }
    if (allow_cache) {
        m_amounts[AVAILABLE_CREDIT].Set(filter, nCredit);
        m_is_cache_empty = false;
    }
    return nCredit;
}
CAmount CWalletTx::GetImmatureWatchOnlyCredit(const bool fUseCache) const