Partially fixing future.wait/wait_for/wait_until
Fixed #999: Optimize hpx::when_n