Fixed issue with anonymous connections in MongoDB

If no user and password were defined when using MongoDB, the connection wasn't opened and so nothing happened and no error were thrown. I changed a condition to always open the connection and perform the authentification only if needed. 
I spent a lot of time figuring out why nothing happened when I tried to connect to MongoDB, I hope it helps someone.