Fix a bug in the new static root redirect w.r.t. trailing slashes

This fixes a bug where the static middleware did not properly
detect that the pathname ended in a slash before sending a redirect
for the root mount point.
Merge pull request #941 from dougwilson/fix/static-root-redirect-bug

Fix a bug in the new static root redirect w.r.t. trailing slashes