I notice two mistakes in your derivation thus far. It seems that your formula for $r(\phi)$ does not describe an ellipse. The correct expression in polar coordinates is
$$
r = \frac{ab}{\sqrt{a^2\sin^2(\phi)+b^2 \cos^2(\phi)}}
$$
Secondly, once you are in polar coordinates, the arc-length formula involves the square of $\frac{dr}{d\phi}$, not the second derivative $\frac{d^2 r}{d\phi^2}$:
$$
dl = \sqrt{r^2+\left(\frac{dr}{d\phi}\right)^2}
$$
Edit
It looks like you can put it in terms of a single ellptic integral, I think. Check out here: http://integraltec.com/math/math.php?f=ellipse.html, they have the full derivation from Cartesian, and the integral expression they get is the incomplete elliptic integral of the second kind. The difference is that their angle, $\theta$, is not a physical angle on the ellipse, but defined as $\sin(\theta)=x/a$. So you should be able to express your angle $\phi$ in terms of their angle $\theta$ by algebraic/trigonometric relationships and identities, then map $\phi$ to $\theta$ and substitute into the elliptic integral. This isn't a full solution, but gives you the flavor of how you can get an expression in terms of the ellipse parameters, elliptic integrals, and the radial angle to give you the arc length.
I prefer to have the singular behaviour near $0$ rather than at $\frac{\pi}{2}$, so let's make the substitution $\varphi = \frac{\pi}{2} - \theta$. We obtain
$$K(k) = \int_0^{\frac{\pi}{2}} \frac{d\varphi}{\sqrt{1 - k^2\cos^2\varphi}}.$$
Split the integral at $\frac{\pi}{4}$. The part
$$\int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \frac{d\varphi}{\sqrt{1 - k^2\cos^2\varphi}}$$
remains harmless as $k \to 1$ and tends to
$$\int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \frac{d\varphi}{\sin \varphi}.$$
For the other part, write $1 = \sin^2 \varphi + \cos^2 \varphi$ to obtain $1 - k^2\cos^2\varphi = \sin^2 \varphi + (1-k^2)\cos^2 \varphi$. Let $\varepsilon = \sqrt{1-k^2}$. Then
\begin{align}
\int_0^{\frac{\pi}{4}} \frac{d\varphi}{\sqrt{1 - k^2\cos^2 \varphi}} &= \int_0^{\frac{\pi}{4}} \frac{\cos^2 \varphi + \sin^2 \varphi}{\sqrt{\cos^2 \varphi + \sin^2 \varphi}\cdot \sqrt{\sin^2 \varphi + \varepsilon^2 \cos^2\varphi}}\,d\varphi\\
&= \int_0^{\frac{\pi}{4}} \frac{1 + \tan^2\varphi}{\sqrt{1 + \tan^2 \varphi}\cdot \sqrt{\varepsilon^2 + \tan^2 \varphi}}\,d\varphi \tag{$t = \tan \varphi$}\\
&= \int_0^1 \frac{dt}{\sqrt{1+t^2}\cdot \sqrt{\varepsilon^2 + t^2}}\\
&= \int_0^1 \frac{dt}{\sqrt{\varepsilon^2 + t^2}} - \int_0^1 \Biggl(1 - \frac{1}{\sqrt{1+t^2}}\Biggr) \frac{dt}{\sqrt{\varepsilon^2 + t^2}}.
\end{align}
Since
$$1 - \frac{1}{\sqrt{1+t^2}} = \frac{\sqrt{1+t^2}-1}{\sqrt{1+t^2}} = \frac{t^2}{\sqrt{1+t^2}\cdot (1 + \sqrt{1+t^2})},$$
the last integral remains bounded and tends to
$$\int_0^1 \frac{t \,dt}{1 + t^2 + \sqrt{1+t^2}}$$
as $\varepsilon \to 0$.
And the substitution $t = \varepsilon u$ gives us
\begin{align}
\int_0^1 \frac{dt}{\sqrt{\varepsilon^2 + t^2}} &= \int_0^{\frac{1}{\varepsilon}} \frac{du}{\sqrt{1+u^2}}\\
&= \operatorname{Ar sinh} \frac{1}{\varepsilon}\\
&= \log \biggl(\frac{1}{\varepsilon} + \sqrt{1 + \frac{1}{\varepsilon^2}}\biggr)\\
&= \log \frac{1}{\varepsilon} + \log 2 + \log \frac{1 + \sqrt{1+\varepsilon^2}}{2}.
\end{align}
Thus we have
$$K(k) = \log \frac{1}{\sqrt{1-k^2}} + O(1) = \frac{1}{2}\log \frac{1}{1-k} - \frac{1}{2}\log (1+k) + O(1) = \frac{1}{2}\log \frac{1}{1-k} + O(1).$$
In our specific case, with $k = \sin \bigl(\frac{\pi}{2} - \frac{\delta}{2}\bigr) = \cos \frac{\delta}{2}$, we have $\varepsilon = \sqrt{1-k^2} = \sin \frac{\delta}{2} = \frac{\delta}{2} + O(\delta^3)$, so
$$\log \frac{1}{\varepsilon} = \log \frac{2}{\delta} + O(\delta^2)$$
and overall
$$K\bigl(\cos \tfrac{\delta}{2}\bigr) = \log \frac{1}{\delta} + O(1),$$
where the $O(1)$ term is not only bounded, it in fact converges as $\delta \to 0$. We have the relevant terms:
$$K\bigl(\cos \tfrac{\delta}{2}\bigr) = \log \frac{1}{\delta} + 2\log 2 + \int_0^1 \frac{t\,dt}{1+t^2+\sqrt{1+t^2}} + \int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \frac{d\varphi}{\sin \varphi} + o(1).$$
Best Answer
Following the Hanning Makholm's suggestion, we have $$ I = \left(1-\frac{k}{2}\right)^{3/2}\int_{0}^{\pi/2}\frac{d\theta}{(1-k\sin^2\theta)^{3/2}},\tag{1}$$ on the other hand: $$ \begin{eqnarray*}\int_{0}^{\pi/2}\frac{d\theta}{(1-k\sin^2\theta)^{3/2}}&=&\int_{0}^{\pi/2}\frac{d\theta}{(1-k\cos^2\theta)^{3/2}}=\int_{0}^{+\infty}\frac{(1+t^2)^{1/2}}{((1-k)+t^2)^{3/2}}\,dt\\&=&\frac{1}{1-k}\int_{0}^{+\infty}\frac{(1+(1-k)u^2)^{1/2}}{(1+u^2)^{3/2}}\,du\\&=&\frac{1}{1-k}\int_{0}^{\pi/2}\left(\cos^2\theta+(1-k)\sin^2\theta\right)^{1/2}\,d\theta\\&=&\frac{1}{1-k}\int_{0}^{\pi/2}\sqrt{1-k\sin^2\theta}\,d\theta = \color{red}{\frac{E(k)}{1-k}}. \end{eqnarray*}$$