Fix memory leak and cleanup after install

Lists were not cleaned correctly after an installation.
Firstly, dinamically allocated structures
were not freed. Then the accepted hardare configuration
list was not cleaned, making possible to install
a not suitable image if previously a correct image
was installed.

Signed-off-by: Stefano Babic <sbabic@denx.de>