Dirs: Export create_dirs function

We need them in the test suite
tests/usercounter: Fix test case

This makes it work without a configured account but also shows that
UserCounter currently does not sort the inserted users on the fly and
instead relies on the database sorting.
tests: Create directories

We need to ensure that our config/cache directories exist before
executing the test cases, because they probably don't in the case that
the application itself has never been started before.