http: fix inverted sync/async condition