Third party reg - optimisation and fix for multiple identities

Mike, this is the fix to https://github.com/Metaswitch/sprout/issues/179 which you suggested. It passes both UTs and my new live tests (https://github.com/Metaswitch/clearwater-live-test/compare/registrar_test?expand=1) which were written specifically to hit the issue with implicit registration.