Refugia from asteroid impacts on early Mars and the early Earth