[Build] Support java_in_dir in gyp build

In extension we don't put Java source code in src/, while 'java_in_dir'
requires a directory with src/, so we need to change this logic in order
to support 'java_in_dir' in java.gypi