Get localvar via buffer-ptr, don't rely on `weechat-buffer-ptr'.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>