rw: Rework PrefixedWriter.Write + add more test-cases