Input controller: free memory at exit

This solves the black screen bug. Screen was staying black after program exit.