A judge in southern Thailand shot himself in court after delivering a not guilty verdict in the case of five Muslim suspects charged with murder in the predominantly Buddhist country’s restive south.