Use a given id when calling a method, if necessary

This makes possible to use different request ids for different
calls of a method. The id is not generated inside the library but
given as a parameter to avoid unnecessary thread-safety measures
in single threaded process. These are the responsibility of the
user of the library.

Signed-off-by: Alexander Lukichev <alexander.lukichev@espotel.com>