use packaged gem files mode as hint only

proposal to fix one of the problems in #1040, this allows systems `umask` to be applied properly to extracted gem files

to fully avoid #1002 it would be required to know `spec.executables` so the `775` could be forced on those files
please explain, the `if` had to be moved up front because now it also applies to the `target_mode` calculation ... unless you would prefer:
```ruby
open(destination, 'wb', install_mode(entry.full_name, entry.header.mode)) do |out|
  out.write entry.read
end if entry.file?
```
but then the line gets quite long and harder to understand