Update PDO lastId() method to improve support for Pgsql and Sqlsrv.