Retired general quits in less than a month in office, breaking record for shortest tenure as national security adviser.