The Near-Infrared Number Counts and Luminosity Functions of Local Galaxies