Fix Javascript error when fetching scroll-position of deleted buffer.
Fix Javascript error when fetching scroll-position of deleted buffer.

We must do it before deleting the buffer.

jmercouris/NeXT,jmercouris/NeXT