Don't add empty entries in hidden files editor with an empty string or when cancel is clicked

This commit avoids ghost entries in the hidden files editor when cancel is clicked or when an empty string is inserted on the "add pattern" dialog.