Free up s->d1->buffered_app_data.q properly.

PR#3286
Check there is enough room for extension.