Fix compatibility with NelmioApiDocBundle

The plugin is not compatible with [NelmioApiDocBundle](https://github.com/nelmio/NelmioApiDocBundle), since the `$form->getParent()` calls return `null` when there is no request context.

Therefore, I've added a small fix to not cause errors when this is done. I haven't experienced any problems because of this.