[PATCH v2] security_manager: Ensure top lock is acquired before nested locks