use a nested transaction each row when importing CSV

This avoids leaking updates to the database in case a row fails to be
imported for some reason.

Bug: 1085149
Change-Id: I626fbfca3c3c8a352384e5b9b8eae235d4a218fb
Report an error when an empty CSV file is imported

Bug: 1085238
Change-Id: Ibcfca94ea4deb56355ecc6cb797947148a796b04