Avoid locked options to be selected and deleted.

Fix for issue #1634.

Avoid the locked options to be selected and deleted.