Inverse magnetic catalysis in the linear sigma model with quarks