Allow specification of gem subdir permisisons

This allows people installing RubyGems to reuse the API but provide
their own permissions instead of adjusting umask.

Fixes ruby bug #7713