simulator: fix bugs in synchronized load/store introduced in commit 1548aecb4e1ff1b847777354096836c708327b4e