An attachment's state depends on its visibility

There was an invalid assumption that all attachments could be considered
'published', whereas they are only accessible if the thing to which they are
attached is accessible.
Merge pull request #1163 from alphagov/correct_attachment_state_in_document_mappings

An attachment's state depends on its visibility