chromium.py: Extract function to get hash

As many scripts would use this function, now it's extracted to util.py.
This CL also fixes the issue when a commit includes more than one
revision in commit body.