beaker-sync-tasks: Fix a regression introduced in 06cc9f7

Also adds a test to test the script logs (output).

Bug: 1040226
Change-Id: I18eb97606bae1e2700e26648886b9cdd778e35db