The country was already shaken by riots and sectarian violence challenging Morsi’s presidency, and the border incident placed the spotlight on the messy question of who actually controls the country’s national security policy.