[0.9] Fix infinite loop when chopping tree into planks with full inventory.

fixes #4313.

build error is fixed by #4328.