Device that keeps a ship's compass horizontal