Move edge-case handling code for new streams so it actually runs.
Move edge-case handling code for new streams so it actually runs.

Previously we only created a Stream on-the-fly if a SQLException was
raised. However, in an error condition queryForId would simply return null,
resulting in later crashes.

To fix this, we check for a null stream and if so, we create one.

prati0100/zulip-android,prati0100/zulip-android,saketkumar95/zulip-android,abhaymaniyar/zulip-android,abhaymaniyar/zulip-android,zulip/zulip-android,saketkumar95/zulip-android,Sam1301/zulip-android,Sam1301/zulip-android,vishwesh3/zulip-android