Always mark file as not writable if the file has been marked readonly.
Added another writable test, fixed a potential bug in the rdev test.