Fix crash when opening entity form from layer without attribute

When right-clicking in the attribute table of a layer that has
no attribute, no feature is selected. If selecting the 'Edit form'
entry, we got a crash.
Merge pull request #1457 from rouault/fix_crash_attr_table_no_attr_col

Fix crash when opening entity form from layer without attribute