A federal judge dismissed a lawsuit filed by the father of Ahmed Mohamed, the “clock boy” whose homemade invention administrators mistook for a bomb.