Use mutex instead of spinlock for synchronizing a file manager.

We should avoid using a spinlock if a critical section can have
a long running time.

Change-Id: I0ce61a719be370694b9a464341efe84e351c4add