Fix deadlock introduced by e37ff0059

In the previous commit, I changed the logic of '->approve' to no longer
lock. This lead to the test assuming that the other lock would eventually be
given up, which isn't the case. I now test get_by_id_and_lock instead, and make
sure that fails to get a lock as we'd expect.