A unanimous Supreme Court on Thursday sided with Google and Twitter in a pair of cases that had alleged social media liability in terror attacks overseas.