More quoting stuff. It turns out we need to differentiate between:

ninja -t commands | rc -c -

and

ninja -t commands | while read i; do rc -c $i; done

The former needs to unescaped whereas the latter doesn't.