This patch set fixes some hangs and potential crashes with jsonBufferLock contention.
On ESP8266, avoid calling delay() in system context. This fixes some crashes if the lock is contended during web server callbacks. As it is not possible to wait in system context, immediately return failure.
On ESP32, use a recursive semaphore instead of a delay() loop. This improves overall performance as the CPU doesn't cycle needlessly, and fixes hanging up for the timeout interval in cases when the contention is from the same task, eg. two web requests.
Use DEBUG_PRINTF_P for the debug messages, a tiny code size savings.
This patch set fixes some hangs and potential crashes with jsonBufferLock contention.