ARROW-15049: [R] arrowExports.cpp generation changed with glue package 1.5.1
ARROW-15049: [R] arrowExports.cpp generation changed with glue package 1.5.1

This PR fixes the code that creates arrowExports.cpp so that a regression in glue 1.5.1 does not cause massive diffs whenever somebody runs the configure script with `ARROW_R_DEV=true`. I'll also file an issue with glue since this is probably not intended behaviour; however, it's a small fix to make it work with both versions and will probably save some PR headache since a new release might not occur immediately.

How I tested this:

```r
# this
remotes::install_github("cran/glue@1.5.1")
Sys.setenv(ARROW_R_DEV = "true")
remotes::install_github("paleolimbot/arrow/r@r-codegen")
# ...nor this
remotes::install_github("cran/glue@1.5.0")
Sys.setenv(ARROW_R_DEV = "true")
remotes::install_github("paleolimbot/arrow/r@r-codegen")
# ...should cause any diffs in arrowExports.cpp
```

Closes #11936 from paleolimbot/r-codegen

Authored-by: Dewey Dunnington <918f18460f0c7572f85895a6a65dbb2d51424a08@fishandwhistle.net>
Signed-off-by: Jonathan Keane <28d17c45cab2bb8b25bea44a915713e26ce37e1b@gmail.com>

kou/arrow,icexelloss/arrow,laurentgo/arrow,wesm/arrow,kou/arrow,laurentgo/arrow,laurentgo/arrow,apache/arrow,apache/arrow,wesm/arrow,laurentgo/arrow,laurentgo/arrow,kou/arrow,icexelloss/arrow,wesm/arrow,wesm/arrow,kou/arrow,icexelloss/arrow,laurentgo/arrow,kou/arrow,apache/arrow,apache/arrow,apache/arrow,laurentgo/arrow,icexelloss/arrow,laurentgo/arrow,apache/arrow,kou/arrow,icexelloss/arrow,icexelloss/arrow,apache/arrow,wesm/arrow,kou/arrow,wesm/arrow,wesm/arrow,apache/arrow,apache/arrow,kou/arrow,laurentgo/arrow,laurentgo/arrow,icexelloss/arrow,laurentgo/arrow,kou/arrow,kou/arrow,kou/arrow,apache/arrow,icexelloss/arrow,icexelloss/arrow,icexelloss/arrow,apache/arrow,apache/arrow,wesm/arrow,wesm/arrow,kou/arrow,apache/arrow,icexelloss/arrow,kou/arrow,wesm/arrow,wesm/arrow,kou/arrow,laurentgo/arrow,wesm/arrow,apache/arrow,icexelloss/arrow,laurentgo/arrow,icexelloss/arrow,wesm/arrow,laurentgo/arrow,wesm/arrow,icexelloss/arrow,laurentgo/arrow