Directly filter messages by namespace_id for API queries.

Summary:
Now that messages have a namespace_id, we don't need to do the wonky
joining-to-threads thing. This makes the /messages endpoint two to three times
faster on large mailboxes.

Test Plan: Unit tests.

Reviewers: khamidou

Reviewed By: khamidou

Differential Revision: https://review.inboxapp.com/D539