Measurement of Bs0 meson production in pp and PbPb collisions at sNN=5.02 TeV