core: fix crash on buffer close when option weechat.look.hotlist_remove is set to "merged" (closes #199)

(cherry picked from commit c1aa51fa9c9143729455c2fe19b70965abd82375)