[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