Avoid sync in inmemory mode (#1190)
Avoid sync in inmemory mode (#1190)

This makes db.Sync() no-op when badger is running in in-memory mode.
The previous code would unnecessarily load up an atomic and
acquire locks.
dgraph-io/badger,dgraph-io/badger