Make permalink parsing consistent with pages

Require permalink to end in a slash to write an index file.
*__Warning:__ does break some compatibility, though this would only affect a tiny minority of users.*

Addresses #2920.