[Binary][Backend/MySQL/MongoDB] Optimized the db binary command and also improved all backend adapters to gracefully close all opened connections. Problems which caused non-endindig db-command run were fixed.