Months before the collapse of FTX, some of its U.S.-based employees discovered the so-called backdoor that Alameda Research allegedly used to withdraw billions of dollars of customer funds from the cryptocurrency exchange, people familiar with the matter said.