Backport beaker-sync-tasks from 0.15

- Backports all beaker-sync-tasks fixes from 0.15
- Adds a hub URL calculation fix that wasn't needed when
  using gunicorn for testing in Beaker 0.15

Bug: 1030909
Change-Id: I36356682d0fd5883affef92143bba90737bb71e3