refactor: Extract validate_sender_can_write_to_stream().
refactor: Extract validate_sender_can_write_to_stream().

This de-clutters check_message a bit and also makes
it easy to audit our rules for who can write to a
stream.

Also, this works around a bug with Python where its
optimizations for the `pass` instruction make them
not appear to run and show up as uncovered in
coverage reports.

tommyip/zulip,brainwane/zulip,punchagan/zulip,showell/zulip,jackrzhang/zulip,brainwane/zulip,jackrzhang/zulip,hackerkid/zulip,andersk/zulip,zulip/zulip,kou/zulip,hackerkid/zulip,shubhamdhama/zulip,synicalsyntax/zulip,timabbott/zulip,timabbott/zulip,shubhamdhama/zulip,shubhamdhama/zulip,showell/zulip,shubhamdhama/zulip,andersk/zulip,synicalsyntax/zulip,andersk/zulip,timabbott/zulip,kou/zulip,rht/zulip,brainwane/zulip,brainwane/zulip,dhcrzf/zulip,eeshangarg/zulip,zulip/zulip,rishig/zulip,andersk/zulip,timabbott/zulip,shubhamdhama/zulip,kou/zulip,hackerkid/zulip,showell/zulip,rht/zulip,jackrzhang/zulip,tommyip/zulip,eeshangarg/zulip,tommyip/zulip,timabbott/zulip,rht/zulip,dhcrzf/zulip,synicalsyntax/zulip,rht/zulip,kou/zulip,showell/zulip,andersk/zulip,eeshangarg/zulip,rishig/zulip,timabbott/zulip,dhcrzf/zulip,hackerkid/zulip,kou/zulip,rishig/zulip,brainwane/zulip,synicalsyntax/zulip,shubhamdhama/zulip,hackerkid/zulip,jackrzhang/zulip,eeshangarg/zulip,rishig/zulip,eeshangarg/zulip,tommyip/zulip,punchagan/zulip,punchagan/zulip,zulip/zulip,hackerkid/zulip,jackrzhang/zulip,kou/zulip,jackrzhang/zulip,punchagan/zulip,dhcrzf/zulip,dhcrzf/zulip,rishig/zulip,showell/zulip,tommyip/zulip,zulip/zulip,brainwane/zulip,shubhamdhama/zulip,synicalsyntax/zulip,kou/zulip,rht/zulip,zulip/zulip,tommyip/zulip,eeshangarg/zulip,dhcrzf/zulip,hackerkid/zulip,andersk/zulip,andersk/zulip,synicalsyntax/zulip,punchagan/zulip,zulip/zulip,brainwane/zulip,dhcrzf/zulip,zulip/zulip,rht/zulip,showell/zulip,timabbott/zulip,showell/zulip,punchagan/zulip,rishig/zulip,rht/zulip,rishig/zulip,jackrzhang/zulip,eeshangarg/zulip,punchagan/zulip,synicalsyntax/zulip,tommyip/zulip