db: mysqldb: Fix the UnboundLocalError

The code out of try/except peer will not be treated as part of the
block. Thus the return here didn't work with the function but ran
as a single command. 'res' was not a global variable, so the
reture would cause a UnboundLocalError.

Signed-off-by: GuofengLiu <lgf612@sina.com>