ada: Fix inserting of validity checks in lock-free protected subprograms