Fixes race condition in resources

See #1378.
Should probably also set ``blank=True``, so that resources without groups are editable in the admin panel.