Measurement of charm and beauty production at central rapidity versus charged-particle multiplicity in proton-proton collisions at √s = 7 TeV