Add an index on the owner column.

Since we want to present the user with some photos of his own, we’ll
need to be able to look up photos by user.
Protect the Cassandra connection with a mutex.

Fixes «ping failed: out of sequence response» errors.