T1431: release the lock even if discard() caused an exception.
T1431: release the lock even if discard() caused an exception.

It may be better to crash the process in that situation.

vyos/vyos-1x,vyos/vyos-1x,vyos/vyos-1x,vyos/vyos-1x