No, that would be wrong. This patch acquires the yum lock, the rpm db is then implicitely opened later in the middle of the yum guts. You need to close tht db first, before unlocking yum.