[DBAgentMySQL] Fix a problem in which getLastInsertId() doesn't work on upsert.

According to http://dev.mysql.com/doc/refman/5.1/en/insert-on-duplicate.html
Prior to MySQL 5.1.12, it's necessary to do workaround like this
patch.
Merge pull request #788 from project-hatohol/fix-get-last-insert-id-prior-to-mysql-5.12

[DBAgentMySQL] Fix a problem in which getLastInsertId() doesn't work on upsert