[3.6.fb] Fix corruption bug in compaction and Mac compilation error

Summary:
Bring compaction and VersionEdit fix https://reviews.facebook.net/D25581
into 3.6.fb.

Test Plan:
./db_test
./version_edit_test

Reviewers: igor, ljin, sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D27801
[3.6.fb] use fallocate(FALLOC_FL_PUNCH_HOLE) to release unused blocks at the end of file

Summary:
ftruncate does not always free preallocated unused space at the end of file.
In some cases, we pin too much disk space than it should
This is a fix previously reviewed in on https://reviews.facebook.net/D25641

Test Plan: env_test

Reviewers: igor, ljin, sdong

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D27975
[3.6.fb] dynamic disable_auto_compactions

Summary: Pulling diff from https://reviews.facebook.net/D24747

Test Plan:
export ROCKSDB_TESTS=Dynamic
./db_test

Reviewers: ljin, igor, sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D27981
Merge branch '3.6.fb' of github.com:facebook/rocksdb into fix36-dyopt
dummy var to suppress compiler warning/error

Summary: Revmoed this in D25641, causing compiler complain. put it back

Test Plan: make release

Reviewers: igor, yhchiang, rven, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D27891