Merge "sdm: Add mutex lock to avoid accessing freed pointer."