Iran nuclear deal ‘close’, Tehran frees captives as obstacles narrow