Fix error when uploading groups by CSV

This fixes the following error when uploading groups by CSV:

```
 #<NoMethodError: undefined method `assignment' for nil:NilClass>
/home/su/code/Markus/app/models/grouping.rb:400:in `block in
remove_grace_period_deduction'
/home/su/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-3.2.18/lib/active_record/associations/collection_proxy.rb:91:in
`each'
/home/su/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-3.2.18/lib/active_record/associations/collection_proxy.rb:91:in
`method_missing'
/home/su/code/Markus/app/models/grouping.rb:399:in
`remove_grace_period_deduction'
/home/su/code/Markus/app/models/grouping.rb:255:in `add_member'
/home/su/code/Markus/app/models/assignment.rb:487:in `block in
add_csv_group'
/home/su/code/Markus/app/models/assignment.rb:479:in `each'
/home/su/code/Markus/app/models/assignment.rb:479:in `add_csv_group'
/home/su/code/Markus/app/controllers/groups_controller.rb:165:in `block
(2 levels) in csv_upload'
/home/su/code/Markus/app/controllers/groups_controller.rb:162:in `each'
/home/su/code/Markus/app/controllers/groups_controller.rb:162:in
`each_with_index'
/home/su/code/Markus/app/controllers/groups_controller.rb:162:in `block
in csv_upload'
/home/su/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-3.2.18/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
`transaction'
/home/su/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-3.2.18/lib/active_record/transactions.rb:208:in
`transaction'
/home/su/code/Markus/app/controllers/groups_controller.rb:154:in
`csv_upload'
```

This is because `deduction.membership.grouping` is nil. However, it
doesn't makes sense to have an instance of a membership with null
grouping. so there must be something wrong with the deletion of
groupings. When a grouping gets deleted, the dependent memberships and
grace period deductions should also be deleted.

Tested:
- bundle exec rake test
- bundle exec rspec
Merge pull request #1751 from zhangsu/group_upload_csv_error

Fix error when uploading groups by CSV