Disgraced ex-deputy mayor Salim Mehajer has thanked a judge for a "second chance after being jailed for a staged car crash and a scheme to lower traffic fines.