NFL Rulebook, Rule 7, Section 2: Dead Ball covers this. There is no specific rule regarding safeties, because there's no need for one: forward progress applies.
Section 2 Dead Ball
Article 1: Dead Ball Declared. An official shall declare the ball dead and the down ended: (...)
(b) when a runner is held or otherwise restrained so that his forward progress ends
The Safety rule is actually pretty specific anyway: it must be carried behind the goalline by an impetus by a team, meaning, an intentional act (not being driven backwards). Rule 11, Section 5:
SECTION 5 - SAFETY
ARTICLE 1. SAFETY
It is a Safety:
if the offense commits a foul in its own end zone or;
when an impetus by a team sends the ball behind its own goal line, and the ball is dead in the end zone in its possession or the ball is out of bounds behind the goal line.
So no, that would not be a safety, if in the view of the officials the runner's forward progress ended in the field of play beyond his goal line. Of course, if the officials believed that he intentionally backed up to try and gain further yardage, they could rule it a safety; forward progress is a judgement call on the part of the official (though usually a clear one).