Constant-time string comparison in Phalcon\Security::checkHash()

Fix #1755
Test case for #1742
Make Phalcon\Logger\Adapter::commit() clear the queue