As per ticket #2891 the issue was fixed, the patch was merged to master. I can see it in source code of version 3.4.0 However, when I tried the precompiled binary downloaded from the release page (or downloaded from maven central repository https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.4.0/), the problem still occurs.
Then I tried to build it by myself using Visual Studio (2017) as advised by the patch contributor @laszlocsomor (#2969), it works! So apparently, the precompiled binary was not built with Visual Studio. Is it a mistake or there are caveats with Visual Studio that prevent the GA release from being built with Visual Studio? (but we need long path in Windows)
By the way, the Windows binary build is missing in release 3.4.1