Fix a panic in MongoDB backend with concurrent create/revoke (#5463)
Fix a panic in MongoDB backend with concurrent create/revoke (#5463)

When Vault is concurrently creating and revoking leases for MongoDB
users as part of the database secrets engine, and then loses connection
to MongoDB, it can panic. This occurrs because the RevokeUser path does
_not_ lock the mutex, but the CreateUser path does. Both threads of
execution can concurently decide to call c.session.Close() in
mongodb/connection_producer.go:119, and then mgo panics when the second
close attempt occurs.
joelthompson/vault,hartsock/vault,quixoten/vault,hashicorp/vault,quixoten/vault,hashicorp/vault,hashicorp/vault,kingland/vault,joelthompson/vault,rnaveiras/vault,kingland/vault,rnaveiras/vault,kingland/vault,rnaveiras/vault,joelthompson/vault,kingland/vault,hartsock/vault,hashicorp/vault,hartsock/vault,quixoten/vault,rnaveiras/vault,hashicorp/vault,kingland/vault,joelthompson/vault,hashicorp/vault,rnaveiras/vault,quixoten/vault,hartsock/vault,hartsock/vault