MDL-37459 admin: Code improvements for admin defaults.

Split apply_admin_defaults_after_data so the defaults are set before
set_data is called.

Change function from private to protected.

Change check for if module for is an add or an update.