Fix Offline Editing Plugin

Offline editing plugin is broken since a long time(from version 1.7.4?). This fix seems to get it working. Tested on postgis, Ubuntu 12.04.

Addresses these two issues..

http://hub.qgis.org/issues/6146
http://hub.qgis.org/issues/3546

Note: I would like someone to review this pull since I am not exactly sure how the usage is.