US top court upholds anti-terror law