Use `get_user_by()` for `bp_core_get_userid_from_nicename()` and `bp_core_get_userid()`

Previously, these functions used direct DB queries to grab the user ID when
a `user_nicename` or `user_login` was passed.

This commit switches these direct DB queries to use `get_user_by()`, which
caches the query when a persistent object cache is enabled.

Fixes #5696.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8532 cdf35c40-ae34-48e0-9cc9-0c9da1808c22