LWG issue #2252: Add more tests for exception safety. No changes needed in the library