Fix staticfiles panel to work with prefixed STATICFILES_DIRS.

Closes #503 and #507. Many thanks to Alexander Clausen (@sk1p) for the
inspiration for the patch.