[refinement] sanitize AMR_bsize

Setting AMR_bsize to 0 or 1 for non-existing directions often resulted in errors or strange execution of the code.