Fix configuring MongoDB replica set on first run

We were doing it in the compile phase, while mongodb hadn't started yet.

Also, we're adding a loop to wait for mongodb to be reachable, since
otherwise, we just fail after a 5s timeout.
Increase timeouts in waits for mongodb

It's taking more than one minute to start here :/
Wait for a MongoDB master to be available, not just for a MongoDB connection

With a replica set, what matters is that there's one master available.
Otherwise, ceilometer fails to connect to MongoDB.