Deallocate devices on TERM signal (experimental feature)

closes #10