Thornhill defends magistrates over riot sentencing