Use make-local-variable instead of make-variable-buffer-local for kill-buffer-hook.