Benin's government says it foiled a coup attempt by soldiers seeking to "destabilize the state."