bgpd: Fix `dampening flap-statistics json` crash
With fix:
```
exit1-debian-9# sh ip bgp dampening flap-statistics
BGP table version is 22, local router ID is 10.10.10.200, vrf id 0
Default local pref 100, local AS 65001
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network From Flaps Duration Reuse Path
*d 10.0.0.0/24 192.168.0.2 4 00:00:50 00:35:56 65000 ?
*d 10.10.10.100/32 192.168.0.2 4 00:00:50 00:35:56 65000 ?
*d 192.168.1.0/24 192.168.0.2 4 00:00:50 00:35:56 65000 ?
Displayed 3 routes and 10 total paths
exit1-debian-9# sh ip bgp dampening flap-statistics json
{
"vrfId": 0,
"vrfName": "default",
"tableVersion": 22,
"routerId": "10.10.10.200",
"defaultLocPrf": 100,
"localAS": 65001,
"routes": { "10.0.0.0/24": [
{
"valid":true,
"damped":true,
"pathFrom":"external",
"peerHost":"192.168.0.2",
"bdiFlap":4,
"peerUptime":"00:00:54",
"peerUptimeMsec":54000,
"peerUptimeEstablishedEpoch":
1626355135,
"reuseTimerMsecs":
2151000,
"asPath":"65000",
"origin":"?"
}
],"10.10.10.100/32": [
{
"valid":true,
"damped":true,
"pathFrom":"external",
"peerHost":"192.168.0.2",
"bdiFlap":4,
"peerUptime":"00:00:54",
"peerUptimeMsec":54000,
"peerUptimeEstablishedEpoch":
1626355135,
"reuseTimerMsecs":
2151000,
"asPath":"65000",
"origin":"?"
}
],"192.168.1.0/24": [
{
"valid":true,
"damped":true,
"pathFrom":"external",
"peerHost":"192.168.0.2",
"bdiFlap":4,
"peerUptime":"00:00:54",
"peerUptimeMsec":54000,
"peerUptimeEstablishedEpoch":
1626355135,
"reuseTimerMsecs":
2151000,
"asPath":"65000",
"origin":"?"
}
] } }
```
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>