Fix memory leak
Fixing ref-counting memtables
Move NeedsCompaction() from VersionSet to Version

Summary: There is no reason to have functions NeedCompaction(), MaxCompactionScore() and MaxCompactionScoreLevel() in VersionSet, since they don't access any data in VersionSet.

Test Plan: make check

Reviewers: kailiu, haobo, sdong

Reviewed By: kailiu

CC: leveldb

Differential Revision: https://reviews.facebook.net/D15333
Merge branch 'master' into columnfamilies

Conflicts:
	db/version_set.h