Fix to add bufferIds for the tasks created during waitForFreeNode

Fixes #2135