Add test for write error when no stdin fd