[3.15] gh-153291: Fix data race in readline.get_completer() and get_pre_input_hook() (gh-153362) (gh-154418)
The setters store these hooks while holding the module critical section
(via set_hook's Py_XSETREF), but the getters read and Py_NewRef the same
fields without it. Annotate both getters with @critical_section, matching
the other readline functions (gh-126895).
(cherry picked from commit
90b6a7992ae0ce6959eaa6b6401105582d866037)
Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>