Fix the bug of calling R CMD SHLIB during testing.

The `sourceCpp` will call `R CMD SHLIB` which is affected by the environmental variable "R_TESTS".