Use git sha as part of extension directory for git referenced gems.

Fixes #2947