compat/cuda/ptx2c: remove shell loop; fix BSD sed compat