Fix #462: final and error commands were run in non blocking mode

This made them fail when data was being written on standard outputs