db.authenticate called twice triggering exception

Added a check to make sure that db object is not already authenticated before calling db.authenticate(...) to avoid "java.lang.IllegalStateException: can't call authenticate twice on the same DBObject". This was preventing me from using MongoHQ, which requires authentication. After adding this fix it started working.