Define dassert in terms of invariant rather than fassert

Gives better error messages on failures.
SERVER-13643 Use awaitCommit rather than commitNow in migrate
SERVER-15165 Don't error out when passed 0 len to writtingPtr