Merge for issue #15744: add tests for the writelines() method of file objects.