don't panic! Houses often take a while to sell, so it may take longer than 5 weeks anyway. The landlord would have to give you notice if the house does sell, and if you did want to stay there after your contract is up then I'm pretty sure the new owners would have to let the real estate know if they wanted tenants or not.

As for breaking your contract if you wanted to move to the other house, what does it say in your lease agreement? I know for ours we have to keep paying rent until our lease runs out or until new tenants are found.