WL#5790: Add server variables as parameters in Binlog::log_statement

This is a step towards making replication a library, such that the 5.6 rpl-lib can
be plugged into the 5.5 core [WL#5675].
In particular, this is a step toward removing function arguments of type THD* from
the interface. This is needed because THD is not stable.
In this worklog, we make the class function Binlog::log_statement() take a list of
server variables as one parameter. Before this worklog, server variables were read
from the THD argument.