rework hhvm tests in framework runner

Summary: this stops the same test running simultaneously multiple times.

Reviewed By: @ptarjan

Differential Revision: D1444509
change lz4compress etc. to lz4_compress for php compatibility

Summary: The php implementation of lz4 compress/decompression has method names lz4_compress and lz4_decompress. HPHP supplies lz4compress and lz4decompress (without spaces). The causes an issue with compatibility of code when running on PHP or HHVM.

https://github.com/kjdev/php-ext-lz4
https://github.com/colinmollenhour/credis/issues/19
https://github.com/colinmollenhour/Cm_RedisSession/issues/31

This renames those methods to lz4_compress, lz4_decompress and lz4_hccompress

Closes https://github.com/facebook/hhvm/pull/3169

Reviewed By: @fredemmott

Differential Revision: D1435396
Fix segfault in substr_replace

Summary: If the 'start' and 'length' arrays were the wrong length, we would walk
off the end of them. Even apart from that, the behavior if they weren't
arrays was wrong: you have to convert them to ints and use those always.

Reviewed By: @edwinsmith

Differential Revision: D1421668
Lock the session file when opening it

Summary: This seems to be a copy+paste mistake from https://github.com/php/php-src/blob/master/ext/session/mod_files.c#L157-L168.

Closes https://github.com/facebook/hhvm/pull/3199

Reviewed By: @ptarjan

Differential Revision: D1438629