Use Python 3.x compatible except construct

Per (proposed) Hacking H203 check, always use the
except x as y: construct, which works with any
Python version >= 2.6, including Python 3.x.

Change-Id: I46028647d5a2a53ba8e9ce4d2e8fc6e71850fdae
Changed processing unique constraint name.

Mr. Devananda found that dollar sign can be used as special symbol in
various programming langugages and proposed to use `0` instead of `$`.
So unique constraint name convention was changed from "uniq_t$c1$c2$c3"
to "uniq_t0c10c20c3" where `0` it is delimiter, `t` it is table name and
columns `c1`, `c2`, `c3` are in UniqueConstraint.

Function `_raise_if_duplicate_entry_error()` modified respectively to
new unique constraint name convention.

Change-Id: I88208dc03b55bbbc709b18580048c008004c9fda
Merge "Changed processing unique constraint name."
Use Python 3.x compatible octal literal notation

0o755 is accepted by Python 2.6 and newer (did not
check older versions)

Change-Id: I764fb56f8ae26c63981a96e1d988d6da37e1bd02