ApplyMigration is a helper test function that encapsulates the general steps
which are needed to properly check the result of applying migration function.
MakeDB creates a new instance of the ChannelDB for testing purposes. A
callback which cleans up the created temporary directories is also returned
and intended to be executed after the test completes.