Fix attempt to traverse boolean when removing cache item

On some systems glob() returns false when mo matches are found.
That's why is didn't work as expected on Arch Linux, for example
(glob() threw a warning when mask didn't match anything).