streams: Extract stream access checks in a function.
streams: Extract stream access checks in a function.

This commit extracts whether a stream is accessible or not
in a new function such that "Subscription" object is passed
by the caller and thus we can use these functions to check
access of multiple streams in a loop without querying the
database in a loop for subscription objects.

zulip/zulip,rht/zulip,zulip/zulip,andersk/zulip,andersk/zulip,zulip/zulip,andersk/zulip,rht/zulip,rht/zulip,zulip/zulip,andersk/zulip,zulip/zulip,andersk/zulip,zulip/zulip,andersk/zulip,rht/zulip,andersk/zulip,rht/zulip,zulip/zulip,rht/zulip,rht/zulip