Gravitational memory in higher dimensions