Only check for native routine registration if .C (or similar) is called

This should filter out cases where packages use Rcpp as their interface
to native code.