[guided]First we prove that $H$ is closed under the Lie bracket. The point is that $D=\operatorname{ad}x$ is not an arbitrary linear map: it is a derivation, so it satisfies
\begin{align*}
D([u,v]) = [Du,v] + [u,Dv]
\end{align*}
for all $u,v\in L$. Iterating this identity gives, for each integer $r\ge 0$,
\begin{align*}
D^r([u,v]) = \sum_{i=0}^r \binom{r}{i}[D^i u, D^{r-i}v].
\end{align*}
Now take $u,v\in H$. By definition of $H$, we have $D^n u=0$ and $D^n v=0$. In the displayed formula with $r=2n$, every summand contains either $D^i u$ with $i\ge n$ or $D^{2n-i}v$ with $2n-i\ge n$. Hence every summand is zero, so
\begin{align*}
D^{2n}([u,v])=0.
\end{align*}
Because the kernels of powers of $D$ have stabilized by exponent $n$, $\ker D^{2n}=\ker D^n=H$. Therefore $[u,v]\in H$, and $H$ is a Lie subalgebra.
We also need to know how $H$ acts on the complementary space $M$. To make the eigenvalue bookkeeping legitimate over an arbitrary field $k$, extend scalars to an algebraic closure $\overline{k}$. Define
\begin{align*}
\overline{L} := L \otimes_k \overline{k}, \qquad \overline{D} := D \otimes_k \operatorname{id}_{\overline{k}}.
\end{align*}
The subspace
\begin{align*}
\overline{H} := H \otimes_k \overline{k}
\end{align*}
is the generalized eigenspace of $\overline{D}$ for eigenvalue $0$, and
\begin{align*}
\overline{M} := M \otimes_k \overline{k}
\end{align*}
is the direct sum of all generalized eigenspaces for nonzero eigenvalues.
We only need the special case in which the first vector has generalized eigenvalue $0$ and the second vector has nonzero generalized eigenvalue $\mu$. This special case is characteristic-free because no division by binomial coefficients is involved. Fix $u\in \overline{H}$ and let $v$ lie in the generalized eigenspace $E_\mu$ of $\overline{D}$ for some $\mu\in \overline{k}^{\times}$. Choose integers $a,b\ge 1$ such that
\begin{align*}
\overline{D}^{a}u=0,\qquad (\overline{D}-\mu I)^b v=0.
\end{align*}
The key identity is that $\overline{D}-\mu I$ differentiates the bracket as $\overline{D}$ on the first entry and as $\overline{D}-\mu I$ on the second entry:
\begin{align*}
(\overline{D}-\mu I)[w_1,w_2]=[\overline{D}w_1,w_2]+[w_1,(\overline{D}-\mu I)w_2]
\end{align*}
for all $w_1,w_2\in \overline{L}$. Iterating this identity gives, for every integer $r\ge 0$,
\begin{align*}
(\overline{D}-\mu I)^r[u,v]
=\sum_{i=0}^{r}\binom{r}{i}[\overline{D}^{i}u,(\overline{D}-\mu I)^{r-i}v].
\end{align*}
Now set $r=a+b-1$. In each summand, either $i\ge a$, in which case $\overline{D}^{i}u=0$, or $r-i\ge b$, in which case $(\overline{D}-\mu I)^{r-i}v=0$. Thus
\begin{align*}
(\overline{D}-\mu I)^{a+b-1}[u,v]=0.
\end{align*}
Therefore $[u,v]\in E_\mu$. Since $\overline{M}$ is the direct sum of the generalized eigenspaces $E_\mu$ with $\mu\ne 0$, this proves
\begin{align*}
[\overline{H},\overline{M}] \subset \overline{M}.
\end{align*}
Since this inclusion is obtained after scalar extension from $k$ to $\overline{k}$, intersecting back with the original $k$-vector space $L$ gives
\begin{align*}
[H,M]\subset M.
\end{align*}[/guided]