Improve transaction handling in document import code.
Improve transaction handling in document import code.

This code change was created after experiencing PostgreSQL behavior of handling
IntegrityErrrors. The major change is to ensure the actual importer runs in
transaction (commit_on_success) and can properly clean up anything it created
(including attachments).

Some minor changes are to the public API, it is no longer using transaction
decorators. There is also some supplementary logging to help figure out where
problems creep.


OSSystems/lava-server,OSSystems/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server,Linaro/lava-server