On conditions for stability of solutions of pendulum-type equations