Reset data_source to NULL upon detaching

Prevents pointer dereference to possibly freed data source in the destructor
Merge pull request #200 from viciious/controlsfix

Reset data_source to NULL upon detaching