fix: properly restore locale after test

Closes #708