Bipolar magnetism in a two-dimensional NbS2 semiconductor with high Curie temperature