pipe: Fix buffer offset after partially failed read