[2371] Use cursor.lastrowid instead of SELECT query for SQLite/MySQL.

Problem
-----

Both `SQLite` and `MySQL` Python DB-APIs provide last insert row ID value using a cursor property thus making a second query not required.

Changes
-----

Instead of using a SELECT statement to retrieve the last inserted row ID both SQLite/MySQL configurations were changed to use `cursor.lastrowid`.

How to test
-----

reviewers @adiroiban 

Please check that the code changes make sense. Thanks!

PS: I've already prepared two system tests for server (SQLite/MySQL) to check that the saved entry ID's is updated accordingly.