WASHINGTON — Janet Napolitano, the secretary of homeland security, announced Friday that she was stepping down, setting off a search to fill one of the most challenging positions in government at a time when the Obama administration is struggling to get a team in place for the president’s second term.