batman-adv: Add reference counting + nullptr fixes

No match.