Added Write API Media test & various fixes

Requires https://github.com/sonata-project/SonataMediaBundle/pull/511