Experimental study of flux pinning in NbN films and multilayers: ultimate limits on critical currents in superconductors