Wait until PrintOperation finishs in some way

Because we are using a thread to generate the report, the connection could be
closed before it's totally generated.
To work around this, wait until PrintOperation is sendingdata/finished/aborted.

(cherry picked from commit 612311376491a848a2a6d25965ffaadb103602cc)

Change-Id: Ie3fa2bb735f70c8c8adacd7f81593b8624e4e2ed
Merge "Wait until PrintOperation finishs in some way" into 1.7