This is a follow-up to the question Change from old style numbers to lining numbers in lineno's linenumbers environment
I've discovered that the suggestion given there doesn't target the line number that gets printed in the margin next to section headings. They are still being printed with old style numbers. How can I make these appear as lining numbers as well?
\documentclass{article}
\usepackage{lipsum,fontspec,lineno}
\setmainfont[Numbers=OldStyle]{Linux Libertine O}
\renewcommand\linenumberfont{\scriptsize\addfontfeatures{Numbers=Lining}}
\begin{document}
\begin{linenumbers}
\section{My first section}
\lipsum[1]
\section{My second section}
\lipsum[2]
\end{linenumbers}
\end{document}