Helper for waiting for (async) task