On the contact-line pinning in cavity formation during solid–liquid impact