hhvm: cherry-pick patch from upstream

this fixes https://github.com/facebook/hhvm/pull/3404

Change-Id: I9971962f7d9035567c031fc0cf6de2adae6e2973