core: Fix uninitialized number of interface listeners

Closes issue #246, reported by cityant
(cherry picked from commit 53e48e1b935b4dfbba11fb54ee105d995c4524db)