Setup the external share manager in a hook

To make sure the external shares are initialized in the right order and
make sure the session is correctly initialized before, the external
share manager is now set up in a filesystem setup hook.

Fixes #9149 

Please review @schiesbn @icewind1991