Two populations of X-ray pulsars produced by two types of supernova