Fix try/catch in internal paste with original data
The insert data call, which throws the exception, was accidentally
moved out of the try block.
Refactor so that only that call is inside the try block to avoid
future confusion, and to avoid surpressing other errors.
Also add a unit test.
Bug: T195514
Change-Id: Iec9dc5c76a377f59a744b18da5da8eed5c52eb24
(cherry picked from commit 55e1c1424d9525ff9911ad1d5a3f6b0c89c382aa)