[cs] fix embedding resources in subdirectories

also, move recursive mkdir from gencpp to common
[java] create directories for resources (hxjava fix required)
Merge pull request #2384 from nadako/cs_subdir_resource_fix

[cs,java] fix embedding resources in subdirectories