libmodprobe: add missing locks in LoadWithAliases

`Modprobe::LoadWithAliases` searches `module_loaded_` for a new element
without holding the lock of `module_loaded_lock_`. However,
`InsmodWithDeps` will insert an element later in this function, and
`LoadWithAliases` can be called by `LoadModulesParallel` in parallel.
Therefore `LoadWithAliases` touches `module_loaded_` while it's being
modified by other threads. That means it accesses corrputed memory.

This change inserts a necessary lock to fix this bug of
`LoadModulesParallel` and `LoadWithAliases`. This change does not
include changes to add thread safety annotations to prevent future same
problem, but following other changes will do that.

Bug: 400592897
Test: cuttlefish boots
Change-Id: Ib52a3b147cbe4122ae42c9fd377e9ea728a4aa41
1 file changed