Make MessageCache handle lock timeouts better