main/quagga: apply fix to rare bgpd crash during route selection

patch picked up from Cumulus Network's quagga patch queue

(cherry picked from commit 102e9e432d62d3b838b7d08923cbb456cfa1b65c)