He was not a junior security officer before Tasha's death
The simple answer is that he was not part of the security crew before Yar died. From his career summary on the official Star Trek web site:
Starfleet Career Summary
2364 : As lieutenant j.g. in command division, assigned to U.S.S. Enterprise as relief conn and tactical officer under Capt. Jean-Luc Picard, later made acting security chief
2365 : Promoted to lieutenant, named permanent Enterprise security chief.
(Source — "Worf" database entrySource — StarTrek.com "Worf" database entry)