Only store user credentials when SMB_OC storage is enabled

Port of #11747 to master