Implement socket_base_t::get_credential member function

The get_credential () member function returns
credential for the last peer we received message for.
The idea is that this function is used to implement user-level API.
Merge pull request #819 from hurtonm/master

Implement socket_base_t::get_credential member function