Allow deletion of media that are associated with galleries.

Right now the way the mapping is set up there is no cascade of deletes from the Media to the GalleryHasMedia. This means that if you attempt to delete Media and there are still GalleryHasMedia entities pointing at it you get a foreign key error.

Closes #576

Cascade removal from Media to GalleryHasMedia.
it could be made a configuration option whether you want to allow deleting a media that is used in galleries or block them from being deleted.
but then the situation of not cascading should be detected and the admin provide a list of the galleries this media is used in, so the user can remove it from those galleries. just doing a fatal error sounds wrong.

btw, this is not related to phpcr-odm, is it? its the same problem for all doctrines?