Use OClosure to drop `advice--buffer-local-function-sample` hack

* lisp/emacs-lisp/nadvice.el (advice--forward): New OClosure, to
replace `advice--buffer-local-function-sample`.
(advice--set-buffer-local, advice--buffer-local): Adjust accordingly.
10 jobs for master in 219 minutes and 59 seconds (queued for 6 seconds)
Status Job ID Name Coverage
  Build Images
failed #76259
build-image-inotify

02:42:05

 
  Normal
skipped #76260
test-all-inotify
 
  Platform Images
failed #76261
build-image-eglot

02:42:04

failed #76263
build-image-gnustep

00:50:43

failed #76262
build-image-tree-sitter

02:41:59

 
  Platforms
skipped #76264
test-eglot
skipped #76266
test-gnustep
skipped #76265
test-tree-sitter
 
  Native Comp Images
passed #76267
build-native-comp-speed2

02:42:44

 
  Native Comp
failed #76268
test-native-comp-speed2

00:56:57

 
Name Stage Failure
failed
test-native-comp-speed2 Native Comp
$ find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete
$ find ${test_name} -type d -depth -exec rmdir {} + 2>/dev/null
Uploading artifacts...
test-native-comp-speed2-b27e2bbb/: found 534 matching files
Uploading artifacts to coordinator... ok
id=76268 responseStatus=201 Created token=2FW3V4ex
Uploading artifacts...
test-native-comp-speed2-b27e2bbb/junit-test-report.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=76268 responseStatus=201 Created token=2FW3V4ex
ERROR: Job failed: exit code 2
failed
build-image-tree-sitter Platform Images
b30949afaae6: Retrying in 5 seconds
Running after_script
Running after script...
$ test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name}
$ test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name}
$ find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete
find: build-image-tree-sitter-b27e2bbb: No such file or directory
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 1

failed
build-image-inotify Build Images
net/http: request canceled (Client.Timeout exceeded while awaiting headers)
Running after_script
Running after script...
$ test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name}
$ test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name}
$ find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete
find: build-image-inotify-b27e2bbb: No such file or directory
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 1

failed
build-image-eglot Platform Images
ad62b0acf715: Retrying in 2 seconds
ad62b0acf715: Retrying in 1 second
net/http: request canceled (Client.Timeout exceeded while awaiting headers)
Running after script...
$ test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name}
$ test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name}
find: build-image-eglot-b27e2bbb: No such file or directory
$ find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete
ERROR: Job failed: exit code 1
failed
build-image-gnustep Platform Images
#12 2200. /usr/include/GNUstep/Foundation/NSThread.h:59:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
#12 2200. 59 | #if GS_EXPOSE(NSThread)
#12 2200. | ^~~~~~~~~~~~~~~~~~~~~
#12 2200. /usr/include/GNUstep/Foundation/NSThread.h:134:55: warning: this use of "defined" may not be por
Running after script...
$ test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name}
$ test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name}
$ find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete
find: build-image-gnustep-b27e2bbb: No such file or directory
ERROR: Job failed: exit code 1