Updated AttachmentMapper to work with new validation in ES 2.0

This change won't compile until https://github.com/elasticsearch/elasticsearch/pull/7534 has been merged. Raising this PR now so it can be reviewed and ready to merge at the same time as the elasticsearch core PR