GALACTICNUCLEUS: A high angular resolution JHKs imaging survey of the Galactic centre. I. Methodology, performance, and near-infrared extinction towards the Galactic centre