[forms] fix form_needs_multipart implementation
problem
-------
The current implementation of form_needs_multipart goes down
recursively in all inlined forms to check if one of them needs
a multipart enctype.
If we have a relation definition as X part_of X, the previous
implementation potentially lead to an infinite recursion