Allow the system locale not to be reset. Fixes #7190.