Error deleting SQL Server local database
You simply need to make sure you have stopped the database before deleting it. 

You can check the current state by running this:

SqlLocalDb info "MyInstance"


and stop it by running :

SqlLocalDb stop   "MyInstance"


Once stopped you should be able to delete the instance.

This is a nice guide on installing and deleting express databases.