Support for selecting Redis databases before executing actual commands

These changes are based on those of Niteesh (https://github.com/twitter/twemproxy/pull/102). The main difference is more correct parameters naming and handling the case when Redis "SELECT" command failed for some reason (for example, there was no such database in Redis) to prevent sending the next (actual client's) commands to Redis as they can be sent to the wrong database.