Constraining the inflationary energy scale from axion cosmology