Close cleanly when trying to read stats over a closed pipe