Fix changes done in RoundCube 1.0-rc

RoundCube changed the workings of insert_id for Postgresql in their 1.0-rc version. This code is not compatible with earlier versions of RoundCube.