Mappings: Fix Get field mapping api with pretty flag

Use  builder.field method instead of XContentHelper#writeRawField

Closes #6552
This seems fragile, since any slight change in the format/structure would cause the test to break.  Could we just check the output contains some newlines (which non pretty results would not)?