Nothing that you do in science is guaranteed to result in benefits for mankind. Any discovery, I believe, is morally neutral and it can be turned either to constructive ends or destructive ends. That's not the fault of science.
In my view, the only recourse for a scientist concerned about the social consequences of his work is to remain involved with it to the end.