With large numbers of CPUs, the calculation of the maximum lock delay could overflow, leading to an unexpectedly low delay. In fact, the maximum delay would calculate to 0 on systems with between 128 and 255 cores (inclusive). Also, when calculating the new delay in lock_delay(), the delay would overflow if the old delay was >= 32,768.
This commit fixes these two overflow. It also updates the maximum delay from 32678 to 32768.
MFC: 2 weeks