Fix buffer size extension in TBasket::LoadBasketBuffers

We need to not only resize in write mode but also
check the size in write mode (as the extra space is
counted or not in BufferSize depending on the
read/write mode).

This fixes ROOT-5616

(cherry picked from v5-34-00 patch branch
 commit ab9d222dc7759685e2520bd7ab5a782319a915e9)