updates demos to not use while(true) and also to generally use non-blocking sends to pipes