check nil on teardown connections.
Merge pull request #416 from yyuu/check-nil-on-teardown-connections

Please check nil on teardown connections.