Add optional user ID parameter for getUseFolder

Backport of #10770 

This is required because the user session hasn't the method `getUser()` so I need to use the static method call `\OCP\User`

cc @icewind1991 @tomneedham