Added confirm dialog when closing a buffer