more fixes to stdbuf support