Tweaking slug logic in post settings.

Fixes #2136. This was also an issue when touching the slug field on an unsaved post.