patch 8.2.2856: get readonly error for device that can't be written to

Problem:    Get readonly error for device that can't be written to.
Solution:   Check for being able to write first. (closes #8205)
diff --git a/src/testdir/test_writefile.vim b/src/testdir/test_writefile.vim
index 8470d4e..75dda81 100644
--- a/src/testdir/test_writefile.vim
+++ b/src/testdir/test_writefile.vim
@@ -285,7 +285,7 @@
         \ && getftype('/dev/loop0') == 'bdev' && !IsRoot()
     new
     edit /dev/loop0
-    call assert_fails('write', 'E505: ')
+    call assert_fails('write', 'E503: ')
     call assert_fails('write!', 'E503: ')
     close!
   endif