Court Backs Bush on Military Detentions