Abstract mlock into functions.

This will let other experiments reserve the uplink for active measurements.