Mach number dependence of the onset of dynamo action