Perform refresh inline with background write operations to avoid race conditions.