If someone came to me today, told me he needed a totally secure router and which one to buy, my answer would probably be "None currently sold". Even business-class routers were recently put into the light, with companies such as Mikrotik, Juniper and Cisco having their fair share of security problems.
The ideal (not always realistic however) solution would be to run a Linux or BSD-based solution of your own. Not only will you fully control the code (as it will be 100% closed-source), but when a security flaw appears in, say, OpenSSL, you can update it almost on the same day as the patch is available. With manufactured devices, you have to wait days, weeks (if not forever) to get an updated firmware.
The second best alternative would be OpenWRT, as it's fully open-sourced, and actively developed.
These aren't always realistic however, so the next best thing is to go with a router that gets either a) frequent AND long-term firmware updates, or b) good open-source/third party support. And disable any cloud or remote access service. If you need remote access, stick to a reliable VPN solution, either OpenVPN or IPSEC-based. Ideally, it should be the only open port on your WAN side (beside your conntracked connection, obviously).
Right, nothing will likely have perfect security. What I meant earlier was the first step to fixing a problem is to stop being in denial about it. Then to formulate a plan to make things better. What this translates to is having a reasonable SLA for addressing security issues and having a channel to securely report issues.
Custom softwares, whether its wrt or something else will always have more security issues. More code translates to more flaws, it's just how software is. It should have its own channel for receiving vulnerability reports from partners or customers.