fixed bugs in friend request functionality

fixed corner cases where two users send requests at the same time or
when one user sends multiple requests before the database query has
been handled