Prevent running the files:scan command as the wrong user

Fixes #9092 

This prevents running the scanner if the current user doesn't have write permissions to the home storage
Since the home storage is required to be writable that means that the scan command is probably executed as the wrong user.

cc @PVince81 @karlitschek