User quota update should not exceed project quota

Move the default user quota setting code from db to quota.py,
because it is necessary to check if user quota is set in db
to get the settable quota for the user under a project.

Fixes bug 1208400

Change-Id: I83a4a7fcd8bf80b20e4e700bad7dd31294f8ed0b
Merge "User quota update should not exceed project quota"