Losses require 49%+ shareholder continuity to maintain losses. Small shareholders (less than 10%) are treated as a notional single person so you only have to be concerned with major shareholders exiting.
Re takeover and forfeiture of losses - who knows, if you want something bad enough, do you really care about $x of losses. You set your takeover price based on future cashflows, it just means you cant factor in the tax shelter provided by the losses. However the Buyer might think their global marketing position will neable them to unlock more value than the existing shareholders do with the losses (ie. can offer a price high enough for you to sell.
As an example, I understand that TelstraClear would have forfeited some losses when Vodafone took them over - Vodafone obviously seeing some integration value exceeding the value of the losses to Telstra. Alternatively, you could see an offer for just 50%, which may retain the losses till utilised (would need to check my maths on this one???).