SQLite compatbility changes

* rename ep_users_per_course index which, on SQLite, can not be the same
  name as an existing table.
* switch 'auto_increment PRIMARY KEY' primitives, AUTOINCREMENT under
  SQLite needs to be placed after the PRIMARY KEY.

Change-Id: Ibd2203f515a32b635f83afbe7f4d4d1fc2d2ee96