Improve error-message on trying to delete a locked object.