Builder: Partial Fix for #1001

- Modified build check to only verify the model if $db_required != ''
and verify the db_migration only if $db_required == 'new'
- Modified the error handling to return an error the same way it would
in case of a write error, and only attempt to write files if the build
check passed (before the failed build check would redirect to home,
which was confusing at best)