Thai court dismisses prime minister