I agree with the existing answers: that it need not be a problem that a team leader / development manager might not be the best developer on the team. Leadership and management ability don't necessarily have a great deal of overlap with robust software development skills.
The reason this answer differs to theirs, though, is that I think there is still a problem here:
for every line of code I refactor there will be 10 new ones
I think it's fine for a team leader to be a less-than-stellar coder if they're not doing much coding or putting themselves on the critical path (i.e. if they prioritize their leadership role over development), but it sounds as though in this case, he is.
In that case, I suggest your question isn't so much "what if I'm a better developer than my Team Leader?", as "how can I introduce best practices in the face of resistance from established/senior developers?"
That's tricky and will take patience. Code reviews are a step in the right direction, as are static analysis tools, unit tests coverage, and so on - though getting their use accepted may be a challenge. There are other answers to questions like that which would be well worth researching.
Thinking aloud, I wonder also whether your Team Leader may be feeling under pressure to keep coding in addition to leading the team. It may be that he feels he needs to be as productive as he was while "just" a coder, as well as doing his leadership role. Perhaps a perceived lack of time might be to blame for the poor quality of his check-ins; perhaps he needs more trust in his team to do the work while he takes a back seat. I don't know, but it might be worth considering the situation from his point of view - maybe even discussing it with him informally, just to sound him out ("good morning boss - so, got much on today?" might be eye-opening!). This will help to learn whether he is a poor programmer who doesn't even know it but has the authority to overrule anyone who points it out (a very difficult situation to deal with), or was once a good programmer but his leadership responsibilities mean he doesn't have time to do it properly any more, and he just needs to learn to let you and the rest of the time handle it. With a better understanding of that, your path may become clearer.
Would it be recommended if to try "take his place" as a team leader?
No.
If you see a leadership role as the next step in your career, then by all means, work towards becoming Team Leader (which may some day mean succeeding the current Team Leader, but that's somewhat less aggressive than "trying to take his place" sounds!). Personally, I'd start here.
If, OTOH, you just want to be the best developer you can be, and you have fallen into the trap of thinking that Team Leader is reward or recognition for being the best developer... focus instead on improving practices both in yourself and across the team, and leave the leadership and management to those who want to lead and manage. (That role is, or should be, a lot more about people than about coding). This might help see the difference.