Merge "Revert "Fix memory leak where we close the descriptor instead of the file."" into lmp-dev