First-principles study of the critical thickness in asymmetric ferroelectric tunnel junctions