Measurement of the gravitational constant with a mass comparator