Merge "diag: Add mutex protection while writing to smd"