Fix Connection::insert() with empty data given

This is a different approach to PR #395 and keeps best possible performance in mind when it comes to doing bulk inserts. This is also a fix for the first approach from PR #314.