Fixed migrations to allow custom user models

The migrations now allow custom user models to be used with custom (non-integer) primary key fields.
We tested them and they work.
Sorry about the code duplication but I did not find a module where ```get_user_pk_field_fully_qualified_name()``` should be.
Maybe in compat.py?

Please merge and release :)