Wrongly incarcerated man and NYC reach settlement deal