Fix subproc listening when setting filter to non-t (Bug#36591)

* src/process.c (Fset_process_filter): Call add_process_read_fd
according to the state of process filter before it's updated.  This
restores the correct functioning as it was before 2016-02-16 "Allow
setting the filter masks later".  Inline the set_process_filter_masks
call instead of fixing it that function, because it is also called
from connect_network_socket, and we don't want to change the behavior
of that function so close to release.
* test/src/process-tests.el (set-process-filter-t): New test.
1 job for emacs-26 in 25 minutes and 20 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Test
failed #2700
test

00:25:20

 
Name Stage Failure
failed
test Test
make[2]: *** [check-doit] Error 1
make[1]: *** [check] Error 2
Makefile:285: recipe for target 'check-doit' failed
make[2]: Leaving directory '/builds/emacs/emacs/test'
Makefile:255: recipe for target 'check' failed
make[1]: Leaving directory '/builds/emacs/emacs/test'
Makefile:951: recipe for target 'check' failed
make: *** [check] Error 2
ERROR: Job failed: exit code 1