patch applied (hugs98): Add FlushBufferUnlock, in order to get the locking just right