Handle the case where an append can fail.

Return an error back to the user if an insert operation happens to fail
against the dets table.
Merge pull request #5 from SyncFree/bugfix/csm/handle-failed-insert

Handle the case where an append can fail.