Fix intermittent failure when editing permissions
Fix intermittent failure when editing permissions

From close inspection of the parameters from when the errors occurred,
an ID was not being supplied by the browser for the permission which
the server was trying to create.

I believe that the following happened (and I successfully reproduced):
 * The user was created/edited once, and they did not have a pre-existing permission
   for one or more application. The server therefore created it on submit.
 * The admin user clicked back (i.e. not being rendered a fresh page containing the
   new permission ID)
 * They submitted again, and the server tried to create another permission, but failed
   because it already existed.

The fix, therefore, is to always create the permission before it is
rendered to the browser, hence it always has an ID.

alphagov/signonotron2,alphagov/signonotron2,alphagov/signonotron2,alphagov/signonotron2