misc: fixed write compare operation

Fix misc driver write operation so that it compares the strings and
returns a failure if they are different.