Fixed #1211: Direct actions cause the future's shared_state to be leaked