Far- and near-field second-harmonic imaging of ferroelectric domain walls