Mappings: Fix Get field mapping api with pretty flag

Use  builder.field method instead of XContentHelper#writeRawField

Closes #6552
I think checking for newline is better than relying on pretty printing having space between key/object...