The pipe_lock and spin_lock (via Relax_lock) locks are now reentrant locks.
This allows nested locking via one thread, which is necessary as the functions of generic_fns.pipes
and generic_fns.mol_res_spin often call functions of the same module in a nested way.