[media] media_device: move allocation out of media_device_*_init