Use loaded_from only when non-nil

For a gem which is not installed in specified path
"loaded_from" will return nil and hence check for builtin_gem?
will throw error.

Fixes #2915, #2963
Fix deploying git gems without git (#2968)

If git isn't allowed to run, we don't blow up if we don't have it.
good grief why a proc it doesn't change
no more weird-looking if/else