Add support for regenerating metadata

Currently metadata is only saved when a record is created, thus the data in the record becomes invalid when a file is replaced.

This problem is somewhat covert by the metadata injection that takes place after retrieving a record, however this only works when the model which has the behavior attached is queried directly, and of course the data in database should be valid anyway.

This patch adds support for regenerating metadata when a record is updated.

See also https://github.com/davidpersson/media/issues/67