Honestly, I'm not seeing WG would "kill" Cobra simply because he's asking too much questions. I'm thinking this is all a part of a bigger plan to direct Luffy, the Revolutionary Army, the Marines, and Blackbeard to a big three-way war
Which I can seque to my theory: Imu is looking for a successor, and he wants to know which one is fit to ascend to the throne by forcing them to duke it out. I mean, think it again, a lot of the recent story developments revolved around the "Successor of the will of D". I'm thinking the battle between Rogers and Rocks was a failed similar attempt, where instead the victor (Roger) refused and that's why they killed him