Thanks for report and relevant troubleshooting hints!
I pushed a patch for it as part of commit 5940e759a754644d29e4145eea648ede45b4b356. This was backported to branch 5.0.
In branch 4.4 was a partial backport with commit 7a3f89954ef1d2daf49fb9a7b7e080c2edecc174. This one should be easy to cherry pick to older branches. At this moment we maintain only last two stable branches, respectively 5.0 and 4.4.