Properly flush memory backend